diff --git a/StructureHelper/StructureHelper.csproj.user b/StructureHelper/StructureHelper.csproj.user
index ea96ed2..bd8bbec 100644
--- a/StructureHelper/StructureHelper.csproj.user
+++ b/StructureHelper/StructureHelper.csproj.user
@@ -87,7 +87,16 @@
Code
-
+
+ Code
+
+
+ Code
+
+
+ Code
+
+
Code
@@ -197,7 +206,13 @@
Designer
-
+
+ Designer
+
+
+ Designer
+
+
Designer
diff --git a/StructureHelper/Windows/MainGraph/FormulaView.xaml b/StructureHelper/Windows/MainGraph/FormulaView.xaml
index 2f5929a..70c763e 100644
--- a/StructureHelper/Windows/MainGraph/FormulaView.xaml
+++ b/StructureHelper/Windows/MainGraph/FormulaView.xaml
@@ -5,8 +5,77 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:StructureHelper.Windows.MainGraph"
mc:Ignorable="d"
- Title="FormulaView" Height="450" Width="800">
+ d:DataContext="{d:DesignInstance local:FormulaViewModel}"
+ Title="TableFunction" Height="300" Width="400"
+ MaxWidth="400"
+ MinWidth="400">
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/StructureHelper/Windows/MainGraph/GraphView.xaml b/StructureHelper/Windows/MainGraph/GraphView.xaml
index aee2c20..6a44b0b 100644
--- a/StructureHelper/Windows/MainGraph/GraphView.xaml
+++ b/StructureHelper/Windows/MainGraph/GraphView.xaml
@@ -19,11 +19,11 @@
+ ItemsSource="{Binding Functions, UpdateSourceTrigger=PropertyChanged}"
+ SelectedItem="{Binding SelectedFuntion, UpdateSourceTrigger=PropertyChanged}">
-
+
diff --git a/StructureHelper/Windows/MainGraph/GraphViewModel.cs b/StructureHelper/Windows/MainGraph/GraphViewModel.cs
index 3391d1b..9fa55ae 100644
--- a/StructureHelper/Windows/MainGraph/GraphViewModel.cs
+++ b/StructureHelper/Windows/MainGraph/GraphViewModel.cs
@@ -148,13 +148,17 @@ namespace StructureHelper.Windows.MainGraph
var tableView = new TableView();
tableView.DataContext = tableViewModel;
tableView.ShowDialog();
+ //SelectedFunction.Name = tableViewModel.Function.Name; //!!!!!!!!!!
+ //SelectedFunction.Description = tableViewModel.Function.Description; //!!!!!!!!!!
}
else if (SelectedFuntion.Type == FunctionType.FormulaFunction)
{
var formulaViewModel = new FormulaViewModel(SelectedFuntion as FormulaFunction);
var formulaView = new FormulaView();
formulaView.DataContext = formulaViewModel;
- formulaView.ShowDialog();
+ formulaView.ShowDialog();
+ //SelectedFunction.Name = formulaViewModel.Function.Name; //!!!!!!!!!!
+ //SelectedFunction.Description = formulaViewModel.Function.Description; //!!!!!!!!!!
}
}
private void Delete()
@@ -179,7 +183,7 @@ namespace StructureHelper.Windows.MainGraph
private void Tree()
{
var treeGraphVM = new TreeGraphViewModel(SelectedFuntion);
- var treeGraph = new TreeGraph.TreeGraph();
+ var treeGraph = new TreeGraph.TreeGraphView();
treeGraph.DataContext = treeGraphVM;
treeGraph.ShowDialog();
}
diff --git a/StructureHelper/Windows/MainGraph/TableView.xaml b/StructureHelper/Windows/MainGraph/TableView.xaml
index 4b6ba22..f232943 100644
--- a/StructureHelper/Windows/MainGraph/TableView.xaml
+++ b/StructureHelper/Windows/MainGraph/TableView.xaml
@@ -16,8 +16,8 @@
-
-
+
+
@@ -85,8 +85,8 @@
-
-
+
+
-
-
+
+
-
+
diff --git a/StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs b/StructureHelper/Windows/TreeGraph/TreeGraphView.xaml.cs
similarity index 88%
rename from StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs
rename to StructureHelper/Windows/TreeGraph/TreeGraphView.xaml.cs
index d9c2376..23ad9df 100644
--- a/StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs
+++ b/StructureHelper/Windows/TreeGraph/TreeGraphView.xaml.cs
@@ -18,9 +18,9 @@ namespace StructureHelper.Windows.TreeGraph
///
/// Interaction logic for TreeGraph.xaml
///
- public partial class TreeGraph : Window
+ public partial class TreeGraphView : Window
{
- public TreeGraph()
+ public TreeGraphView()
{
InitializeComponent();
}
diff --git a/StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs b/StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs
index 87f9ef6..ae5599c 100644
--- a/StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs
+++ b/StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs
@@ -1,17 +1,44 @@
using NLog.Common;
using StructureHelper.Infrastructure;
using StructureHelperCommon.Infrastructures.Interfaces;
+using StructureHelperCommon.Models.Functions;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
+using System.Windows.Input;
namespace StructureHelper.Windows.TreeGraph
{
public class TreeGraphViewModel : ViewModelBase
{
+ private RelayCommand _getYCommand;
+ private RelayCommand _scaleCommand;
+ private RelayCommand _limCommand;
+ private RelayCommand _editCommand;
+ private RelayCommand _deleteCommand;
+ public ICommand GetYCommand
+ {
+ get => _getYCommand ??= new RelayCommand(o => GetY());
+ }
+ public ICommand ScaleCommand
+ {
+ get => _scaleCommand ??= new RelayCommand(o => Scale(o));
+ }
+ public ICommand LimitCommand
+ {
+ get => _limCommand ??= new RelayCommand(o => Limit(o));
+ }
+ public ICommand EditCommand
+ {
+ get => _editCommand ??= new RelayCommand(o => Edit());
+ }
+ public ICommand DeleteCommand
+ {
+ get => _deleteCommand ??= new RelayCommand(o => Delete());
+ }
private ObservableCollection nodes;
public ObservableCollection Nodes { get; set; }
public TreeGraphViewModel(IOneVariableFunction function)
@@ -19,6 +46,33 @@ namespace StructureHelper.Windows.TreeGraph
Nodes = new ObservableCollection();
Nodes.Add(function);
}
+ private void GetY()
+ {
+ var vm = new GetValueViewModel(new TableFunction());
+ var v = new GetValueView();
+ v.DataContext = vm;
+ v.ShowDialog();
+ }
+ private void Scale(object parameter)
+ {
+ var vm = new ScaleViewModel();
+ var v = new ScaleView();
+ v.DataContext = vm;
+ v.ShowDialog();
+ }
+ private void Limit(object parameter)
+ {
+ var vm = new LimViewModel();
+ var v = new LimView();
+ v.DataContext = vm;
+ v.ShowDialog();
+ }
+ private void Edit()
+ {
+ }
+ private void Delete()
+ {
+ }
}
}
diff --git a/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs b/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs
index df1aeca..be94665 100644
--- a/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs
+++ b/StructureHelperCommon/Infrastructures/Interfaces/IOneVariableFunction.cs
@@ -1,6 +1,7 @@
using StructureHelperCommon.Infrastructures.Enums;
using System;
using System.Collections.Generic;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
diff --git a/StructureHelperCommon/Models/Functions/TableFunction.cs b/StructureHelperCommon/Models/Functions/TableFunction.cs
index db6850e..ca8faf4 100644
--- a/StructureHelperCommon/Models/Functions/TableFunction.cs
+++ b/StructureHelperCommon/Models/Functions/TableFunction.cs
@@ -3,6 +3,7 @@ using StructureHelperCommon.Infrastructures.Interfaces;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
@@ -11,14 +12,24 @@ namespace StructureHelperCommon.Models.Functions
{
public class TableFunction : IOneVariableFunction
{
+ private string name;
public bool IsUser { get; set; }
public FunctionType Type { get; set; }
- public string Name { get; set; }
+ public string Name
+ {
+ get => name;
+ set
+ {
+ name = value;
+ }
+ }
public string Description { get; set; }
public List Table { get; set; }
public Guid Id => throw new NotImplementedException();
+ public event PropertyChangedEventHandler? PropertyChanged;
+
public bool Check()
{
throw new NotImplementedException();