diff --git a/StructureHelper/StructureHelper.csproj.user b/StructureHelper/StructureHelper.csproj.user index bd8bbec..8342004 100644 --- a/StructureHelper/StructureHelper.csproj.user +++ b/StructureHelper/StructureHelper.csproj.user @@ -93,6 +93,9 @@ Code + + Code + Code @@ -209,6 +212,9 @@ Designer + + Designer + Designer diff --git a/StructureHelper/Windows/MainGraph/FormulaView.xaml b/StructureHelper/Windows/MainGraph/FormulaView.xaml index 4fadf4b..878d67a 100644 --- a/StructureHelper/Windows/MainGraph/FormulaView.xaml +++ b/StructureHelper/Windows/MainGraph/FormulaView.xaml @@ -1,13 +1,23 @@  + Title="FormulaFunction" Height="640" Width="400"> + + + + + + + @@ -17,6 +27,7 @@ + @@ -134,6 +145,20 @@ + + + + + + + + @@ -144,7 +169,7 @@ VerticalAlignment="Center"/> - + @@ -173,7 +198,7 @@ - diff --git a/StructureHelper/Windows/MainGraph/FormulaViewModel.cs b/StructureHelper/Windows/MainGraph/FormulaViewModel.cs index 8d85811..3582c24 100644 --- a/StructureHelper/Windows/MainGraph/FormulaViewModel.cs +++ b/StructureHelper/Windows/MainGraph/FormulaViewModel.cs @@ -1,5 +1,6 @@  using StructureHelper.Infrastructure; +using StructureHelperCommon.Infrastructures.Enums; using StructureHelperCommon.Infrastructures.Interfaces; using StructureHelperCommon.Models.Functions; using StructureHelperCommon.Services.ColorServices; @@ -103,6 +104,15 @@ namespace StructureHelper.Windows.MainGraph name = value; } } + private FunctionPurpose functionPurpose; + public FunctionPurpose FunctionPurpose + { + get => functionPurpose; + set + { + functionPurpose = value; + } + } private string description; public string Description { @@ -148,6 +158,7 @@ namespace StructureHelper.Windows.MainGraph Formula = formulaFunction.Formula; Step = formulaFunction.Step; Name = Function.Name; + FunctionPurpose = Function.FunctionPurpose; Description = Function.Description; LeftBound = Function.MinArg; RightBound = Function.MaxArg; @@ -173,6 +184,7 @@ namespace StructureHelper.Windows.MainGraph Function.Color = Color; Function.MinArg = LeftBound; Function.MaxArg = RightBound; + Function.FunctionPurpose = FunctionPurpose; var window = parameter as Window; if (LeftBound > RightBound) { diff --git a/StructureHelper/Windows/MainGraph/TableView.xaml b/StructureHelper/Windows/MainGraph/TableView.xaml index 58d5565..96a0a66 100644 --- a/StructureHelper/Windows/MainGraph/TableView.xaml +++ b/StructureHelper/Windows/MainGraph/TableView.xaml @@ -1,16 +1,26 @@  + + + + + + + @@ -19,6 +29,7 @@ + @@ -96,6 +107,20 @@ + + + + + + + + @@ -106,7 +131,7 @@ VerticalAlignment="Center"/> - + @@ -135,7 +160,7 @@ - diff --git a/StructureHelper/Windows/MainGraph/TableViewModel.cs b/StructureHelper/Windows/MainGraph/TableViewModel.cs index 09d5883..e41dc46 100644 --- a/StructureHelper/Windows/MainGraph/TableViewModel.cs +++ b/StructureHelper/Windows/MainGraph/TableViewModel.cs @@ -1,4 +1,5 @@ using StructureHelper.Infrastructure; +using StructureHelperCommon.Infrastructures.Enums; using StructureHelperCommon.Infrastructures.Interfaces; using StructureHelperCommon.Models.Functions; using StructureHelperCommon.Models.Shapes; @@ -79,6 +80,15 @@ namespace StructureHelper.Windows.MainGraph name = value; } } + private FunctionPurpose functionPurpose; + public FunctionPurpose FunctionPurpose + { + get => functionPurpose; + set + { + functionPurpose = value; + } + } private string description; public string Description { @@ -114,6 +124,7 @@ namespace StructureHelper.Windows.MainGraph Function = tableFunction; Table = new ObservableCollection((Function as TableFunction).Table); Name = Function.Name; + FunctionPurpose = Function.FunctionPurpose; Description = Function.Description; Color = Function.Color; } @@ -134,6 +145,7 @@ namespace StructureHelper.Windows.MainGraph Function.IsUser = true; (Function as TableFunction).Table = Table.OrderBy(x => x.X).ToList(); Function.Color = Color; + Function.FunctionPurpose = FunctionPurpose; var window = parameter as Window; window.DialogResult = true; window.Close(); diff --git a/StructureHelper/Windows/TreeGraph/RenameView.xaml b/StructureHelper/Windows/TreeGraph/RenameView.xaml new file mode 100644 index 0000000..e09447c --- /dev/null +++ b/StructureHelper/Windows/TreeGraph/RenameView.xaml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/StructureHelper/Windows/TreeGraph/RenameView.xaml.cs b/StructureHelper/Windows/TreeGraph/RenameView.xaml.cs new file mode 100644 index 0000000..cc6b649 --- /dev/null +++ b/StructureHelper/Windows/TreeGraph/RenameView.xaml.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Shapes; + +namespace StructureHelper.Windows.TreeGraph +{ + /// + /// Interaction logic for RenameView.xaml + /// + public partial class RenameView : Window + { + public RenameView() + { + InitializeComponent(); + } + } +} diff --git a/StructureHelper/Windows/TreeGraph/RenameViewModel.cs b/StructureHelper/Windows/TreeGraph/RenameViewModel.cs new file mode 100644 index 0000000..274e023 --- /dev/null +++ b/StructureHelper/Windows/TreeGraph/RenameViewModel.cs @@ -0,0 +1,42 @@ +using StructureHelper.Infrastructure; +using StructureHelperCommon.Infrastructures.Interfaces; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Input; + +namespace StructureHelper.Windows.TreeGraph +{ + public class RenameViewModel : ViewModelBase + { + + private RelayCommand saveCommand; + public ICommand SaveCommand + { + get => saveCommand ??= new RelayCommand(o => Save(o)); + } + private string functionName; + public string FunctionName + { + get => functionName; + set + { + functionName = value; + OnPropertyChanged(nameof(FunctionName)); + } + } + public RenameViewModel(TreeViewItemViewModel item) + { + FunctionName = item.Name; + } + private void Save(object parameter) + { + var window = parameter as Window; + window.DialogResult = true; + window.Close(); + } + } +} diff --git a/StructureHelper/Windows/TreeGraph/TreeGraphView.xaml b/StructureHelper/Windows/TreeGraph/TreeGraphView.xaml index 38b46b3..7fa4f13 100644 --- a/StructureHelper/Windows/TreeGraph/TreeGraphView.xaml +++ b/StructureHelper/Windows/TreeGraph/TreeGraphView.xaml @@ -7,7 +7,7 @@ xmlns:local="clr-namespace:StructureHelper.Windows.TreeGraph" mc:Ignorable="d" d:DataContext="{d:DesignInstance local:TreeGraphViewModel}" - Title="StructureHelper" Height="700" + Title="StructureHelper" Height="750" Width="1000" MinHeight="400" MinWidth="600"> @@ -18,6 +18,7 @@ + + + + + + + + + +