Fix: return graph from player to independent button, develop: add MainGraphView, TreeView, TreeCommand.
This commit is contained in:
@@ -57,6 +57,9 @@
|
|||||||
<Compile Update="Windows\Graphs\GraphView.xaml.cs">
|
<Compile Update="Windows\Graphs\GraphView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="Windows\MainGraph\AddTable.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Update="Windows\MainGraph\GraphView.xaml.cs">
|
<Compile Update="Windows\MainGraph\GraphView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -81,6 +84,9 @@
|
|||||||
<Compile Update="Windows\Services\CopyByParameterView.xaml.cs">
|
<Compile Update="Windows\Services\CopyByParameterView.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="Windows\TreeGraph\TreeGraph.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
<Compile Update="Windows\UserControls\MultiplyDouble.xaml.cs">
|
<Compile Update="Windows\UserControls\MultiplyDouble.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -158,6 +164,9 @@
|
|||||||
<Page Update="Windows\Graphs\GraphView.xaml">
|
<Page Update="Windows\Graphs\GraphView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="Windows\MainGraph\AddTable.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="Windows\MainGraph\GraphView.xaml">
|
<Page Update="Windows\MainGraph\GraphView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -182,6 +191,9 @@
|
|||||||
<Page Update="Windows\Services\CopyByParameterView.xaml">
|
<Page Update="Windows\Services\CopyByParameterView.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="Windows\TreeGraph\TreeGraph.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
<Page Update="Windows\UserControls\MultiplyDouble.xaml">
|
<Page Update="Windows\UserControls\MultiplyDouble.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
25
StructureHelper/Windows/MainGraph/AddTable.xaml
Normal file
25
StructureHelper/Windows/MainGraph/AddTable.xaml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<Window x:Class="StructureHelper.Windows.MainGraph.AddTable"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:local="clr-namespace:StructureHelper.Windows.MainGraph"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
ResizeMode="CanResize"
|
||||||
|
Title="AddTable" Height="450" Width="400">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="50"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<DataGrid Grid.Row="0" Margin="5">
|
||||||
|
<DataGrid.Columns>
|
||||||
|
<DataGridTextColumn Width="*" Header="X"/>
|
||||||
|
<DataGridTextColumn Width="*" Header="Y"/>
|
||||||
|
</DataGrid.Columns>
|
||||||
|
</DataGrid>
|
||||||
|
<Button Grid.Row="1" Margin="5" Content="Build Graph">
|
||||||
|
|
||||||
|
</Button>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
27
StructureHelper/Windows/MainGraph/AddTable.xaml.cs
Normal file
27
StructureHelper/Windows/MainGraph/AddTable.xaml.cs
Normal file
@@ -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.MainGraph
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for AddTable.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class AddTable : Window
|
||||||
|
{
|
||||||
|
public AddTable()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
14
StructureHelper/Windows/MainGraph/AddTableViewModel.cs
Normal file
14
StructureHelper/Windows/MainGraph/AddTableViewModel.cs
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainGraph
|
||||||
|
{
|
||||||
|
class AddTableViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,15 +3,76 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||||||
xmlns:local="clr-namespace:StructureHelper.Windows.MainGraph"
|
xmlns:local="clr-namespace:StructureHelper.Windows.MainGraph"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="GraphView" Height="450" Width="800">
|
d:DataContext="{d:DesignInstance local:GraphViewModel}"
|
||||||
|
Title="StructureHelper" Height="700"
|
||||||
|
Width="1000" MinHeight="400" MinWidth="600">
|
||||||
<Grid>
|
<Grid>
|
||||||
<TextBlock
|
<Grid.ColumnDefinitions>
|
||||||
Text = "Здесь будет приложение с графиком"
|
<ColumnDefinition Width="300"/>
|
||||||
FontSize="20"
|
<ColumnDefinition Width="*"/>
|
||||||
HorizontalAlignment="Center"
|
</Grid.ColumnDefinitions>
|
||||||
VerticalAlignment="Center"
|
<Grid.RowDefinitions>
|
||||||
/>
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="100"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<ListBox Grid.Row="0" Grid.Column="0" Margin="5"
|
||||||
|
ItemsSource="{Binding Functions}"
|
||||||
|
SelectedItem="{Binding SelectedFuntion}">
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Name}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
|
<Grid Grid.Row="1" Grid.Column="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="100"/>
|
||||||
|
<ColumnDefinition Width="100"/>
|
||||||
|
<ColumnDefinition Width="100"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="50"/>
|
||||||
|
<RowDefinition Height="50"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Button Grid.Column="0" Grid.Row="0" Margin="5" Content="Add table"
|
||||||
|
Background="LightGreen"/>
|
||||||
|
<Button Grid.Column="0" Grid.Row="1" Margin="5" Content="Add formula"
|
||||||
|
Background="LightGreen"/>
|
||||||
|
<Button Grid.Column="1" Grid.Row="0" Margin="5" Content="Edit"
|
||||||
|
IsEnabled="{Binding SelectedFuntion.IsUser, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
Background="LightYellow"/>
|
||||||
|
<Button Grid.Column="1" Grid.Row="1" Margin="5" Content="Delete"
|
||||||
|
IsEnabled="{Binding SelectedFuntion.IsUser, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
Background="LightPink"/>
|
||||||
|
<Button Grid.Column="2" Grid.Row="0" Margin="5" Content="Copy"
|
||||||
|
Background="LightBlue"/>
|
||||||
|
<Button Grid.Column="2" Grid.Row="1" Margin="5" Content="Tree"
|
||||||
|
IsEnabled="{Binding SelectedFuntion.IsUser, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
Command="{Binding TreeCommand}"
|
||||||
|
Background="AntiqueWhite"/>
|
||||||
|
</Grid>
|
||||||
|
<lvc:CartesianChart Grid.Row="0" Grid.Column="1"
|
||||||
|
Series="{Binding SeriesCollection}" Margin="5">
|
||||||
|
<lvc:CartesianChart.AxisY>
|
||||||
|
<lvc:Axis Title="Y"></lvc:Axis>
|
||||||
|
</lvc:CartesianChart.AxisY>
|
||||||
|
<lvc:CartesianChart.AxisX>
|
||||||
|
<lvc:Axis Title="X" Labels="{Binding Labels}"></lvc:Axis>
|
||||||
|
</lvc:CartesianChart.AxisX>
|
||||||
|
</lvc:CartesianChart>
|
||||||
|
<Grid Grid.Row="1" Grid.Column="1">
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="30"/>
|
||||||
|
<RowDefinition Height="70"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TextBlock Grid.Row="0" Text="Description:" Margin="5"/>
|
||||||
|
<TextBlock Grid.Row="1"
|
||||||
|
Text="{Binding SelectedFuntion.Description, UpdateSourceTrigger=PropertyChanged}"
|
||||||
|
Margin="5" TextWrapping="Wrap"
|
||||||
|
VerticalAlignment="Center" Height="60"/>
|
||||||
|
</Grid>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
@@ -1,4 +1,8 @@
|
|||||||
using System;
|
using StructureHelper.Windows.MainWindow;
|
||||||
|
using StructureHelper.Windows.ViewModels.Materials;
|
||||||
|
using StructureHelperLogics.Models.CrossSections;
|
||||||
|
using StructureHelperLogics.Models.Graphs;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
@@ -19,9 +23,15 @@ namespace StructureHelper.Windows.MainGraph
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class GraphView : Window
|
public partial class GraphView : Window
|
||||||
{
|
{
|
||||||
public GraphView()
|
private GraphViewModel viewModel;
|
||||||
|
public GraphView(GraphViewModel viewModel)
|
||||||
{
|
{
|
||||||
|
this.viewModel = viewModel;
|
||||||
|
DataContext = this.viewModel;
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
public GraphView() : this(new GraphViewModel())
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
142
StructureHelper/Windows/MainGraph/GraphViewModel.cs
Normal file
142
StructureHelper/Windows/MainGraph/GraphViewModel.cs
Normal file
@@ -0,0 +1,142 @@
|
|||||||
|
using LiveCharts;
|
||||||
|
using LiveCharts.Wpf;
|
||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
using StructureHelper.Windows.TreeGraph;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using StructureHelperCommon.Models.Functions;
|
||||||
|
using StructureHelperLogics.Models.Graphs;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Windows.Input;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.MainGraph
|
||||||
|
{
|
||||||
|
public class GraphViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
public SeriesCollection SeriesCollection { get; set; }
|
||||||
|
public List<string> Labels { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private IOneVariableFunction selectedFunction;
|
||||||
|
public IOneVariableFunction SelectedFuntion
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return selectedFunction;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
selectedFunction = value;
|
||||||
|
OnPropertyChanged(nameof(SelectedFuntion));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private List<IOneVariableFunction> functions;
|
||||||
|
public List<IOneVariableFunction> Functions { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private RelayCommand addTableCommand;
|
||||||
|
private RelayCommand addFormulaCommand;
|
||||||
|
private RelayCommand editCommand;
|
||||||
|
private RelayCommand deleteCommand;
|
||||||
|
private RelayCommand copyCommand;
|
||||||
|
private RelayCommand treeCommand;
|
||||||
|
public ICommand AddTableCommand
|
||||||
|
{
|
||||||
|
get => addTableCommand ??= new RelayCommand(o => AddTable());
|
||||||
|
}
|
||||||
|
public ICommand AddFormulaCommand
|
||||||
|
{
|
||||||
|
get => addFormulaCommand ??= new RelayCommand(o => AddTable());
|
||||||
|
}
|
||||||
|
public ICommand EditCommand
|
||||||
|
{
|
||||||
|
get => editCommand ??= new RelayCommand(o => AddTable());
|
||||||
|
}
|
||||||
|
public ICommand DeleteCommand
|
||||||
|
{
|
||||||
|
get => deleteCommand ??= new RelayCommand(o => AddTable());
|
||||||
|
}
|
||||||
|
public ICommand CopyCommand
|
||||||
|
{
|
||||||
|
get => copyCommand ??= new RelayCommand(o => AddTable());
|
||||||
|
}
|
||||||
|
public ICommand TreeCommand
|
||||||
|
{
|
||||||
|
get => treeCommand ??= new RelayCommand(o => Tree());
|
||||||
|
}
|
||||||
|
public GraphViewModel()
|
||||||
|
{
|
||||||
|
Functions = new List<IOneVariableFunction>();
|
||||||
|
var f1 = new TableFunction();
|
||||||
|
f1.Name = "Пробная табличная системная функция 1";
|
||||||
|
f1.IsUser = false;
|
||||||
|
f1.Description = "Описание 1";
|
||||||
|
var f2 = new TableFunction();
|
||||||
|
f2.Name = "Пробная табличная пользовательская функция 2";
|
||||||
|
f2.IsUser = true;
|
||||||
|
f2.Description = "Описание 2";
|
||||||
|
var f3 = new FormulaFunction();
|
||||||
|
f3.Name = "Пробная формульная системная функция 3";
|
||||||
|
f3.IsUser = false;
|
||||||
|
f3.Description = "Описание 3";
|
||||||
|
Functions.Add(f1);
|
||||||
|
Functions.Add(f2);
|
||||||
|
Functions.Add(f3);
|
||||||
|
|
||||||
|
|
||||||
|
Labels = new List<string>();
|
||||||
|
Labels.Add("1");
|
||||||
|
Labels.Add("2");
|
||||||
|
Labels.Add("2");
|
||||||
|
Labels.Add("3");
|
||||||
|
var chartValues = new ChartValues<double>();
|
||||||
|
chartValues.Add(1);
|
||||||
|
chartValues.Add(10);
|
||||||
|
chartValues.Add(100);
|
||||||
|
chartValues.Add(25);
|
||||||
|
chartValues.Add(150);
|
||||||
|
chartValues.Add(100);
|
||||||
|
chartValues.Add(200);
|
||||||
|
chartValues.Add(50);
|
||||||
|
var lineSeries = new LineSeries();
|
||||||
|
lineSeries.Values = chartValues;
|
||||||
|
SeriesCollection = new SeriesCollection();
|
||||||
|
SeriesCollection.Add(lineSeries);
|
||||||
|
}
|
||||||
|
/*public GraphViewModel(IGraph graph)
|
||||||
|
{
|
||||||
|
}*/
|
||||||
|
private void AddTable()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
private void AddFormula()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
private void Edit()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
private void Delete()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
private void Cppy()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
private void Tree()
|
||||||
|
{
|
||||||
|
var treeGraphVM = new TreeGraphViewModel(SelectedFuntion);
|
||||||
|
var treeGraph = new TreeGraph.TreeGraph();
|
||||||
|
treeGraph.DataContext = treeGraphVM;
|
||||||
|
treeGraph.ShowDialog();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -140,11 +140,13 @@ namespace StructureHelper.Windows.MainWindow
|
|||||||
}
|
}
|
||||||
private void AddGraphEditor()
|
private void AddGraphEditor()
|
||||||
{
|
{
|
||||||
var editor = new GraphEditorAnalysis();
|
var graphView = new MainGraph.GraphView();
|
||||||
|
graphView.ShowDialog();
|
||||||
|
/*var editor = new GraphEditorAnalysis(); //Код, который встраивал графики в "проигрыватель"
|
||||||
editor.Name = "New Graph Editor";
|
editor.Name = "New Graph Editor";
|
||||||
editor.Tags = "#New group";
|
editor.Tags = "#New group";
|
||||||
var visualAnalysis = new VisualAnalysis(editor);
|
var visualAnalysis = new VisualAnalysis(editor);
|
||||||
ProgramSetting.CurrentProject.VisualAnalyses.Add(visualAnalysis);
|
ProgramSetting.CurrentProject.VisualAnalyses.Add(visualAnalysis);*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,10 +37,10 @@ namespace StructureHelper.Windows.MainWindow.Analyses
|
|||||||
{
|
{
|
||||||
ProcessCrossSection(crossSection);
|
ProcessCrossSection(crossSection);
|
||||||
}
|
}
|
||||||
else if (version.Item is IGraph graph)
|
/*else if (version.AnalysisVersion is IGraph graph)
|
||||||
{
|
{
|
||||||
ProcessEditGraph(graph);
|
ProcessEditGraph(graph);
|
||||||
}
|
}*/
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(version));
|
throw new StructureHelperException(ErrorStrings.ObjectTypeIsUnknownObj(version));
|
||||||
@@ -52,11 +52,11 @@ namespace StructureHelper.Windows.MainWindow.Analyses
|
|||||||
var window = new CrossSectionView(crossSection);
|
var window = new CrossSectionView(crossSection);
|
||||||
window.ShowDialog();
|
window.ShowDialog();
|
||||||
}
|
}
|
||||||
private void ProcessEditGraph(IGraph graph)
|
/*private void ProcessEditGraph(IGraph graph)
|
||||||
{
|
{
|
||||||
var window = new GraphView();
|
var window = new GraphView(graph);
|
||||||
window.ShowDialog();
|
window.ShowDialog();
|
||||||
}
|
}*/
|
||||||
|
|
||||||
public object Clone()
|
public object Clone()
|
||||||
{
|
{
|
||||||
|
|||||||
67
StructureHelper/Windows/TreeGraph/TreeGraph.xaml
Normal file
67
StructureHelper/Windows/TreeGraph/TreeGraph.xaml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
<Window x:Class="StructureHelper.Windows.TreeGraph.TreeGraph"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf"
|
||||||
|
xmlns:local="clr-namespace:StructureHelper.Windows.TreeGraph"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DataContext="{d:DesignInstance local:TreeGraphViewModel}"
|
||||||
|
Title="StructureHelper" Height="700"
|
||||||
|
Width="1000" MinHeight="400" MinWidth="600">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="350"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
<RowDefinition Height="50"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<TreeView Grid.Row="0" Grid.Column="0" Margin="5"
|
||||||
|
ItemsSource="{Binding Nodes}">
|
||||||
|
<TreeView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<TextBlock Text="{Binding Name}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</TreeView.ItemTemplate>
|
||||||
|
</TreeView>
|
||||||
|
<Grid Grid.Row="1" Grid.Column="0">
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
<ColumnDefinition Width="50"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="50"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Button Grid.Column="0" Margin="5" Content="Get Y"
|
||||||
|
Background="Goldenrod"/>
|
||||||
|
<Button Grid.Column="1" Margin="5" Content="ScaleX"
|
||||||
|
Background="Turquoise"/>
|
||||||
|
<Button Grid.Column="2" Margin="5" Content="ScaleY"
|
||||||
|
Background="Turquoise"/>
|
||||||
|
<Button Grid.Column="3" Margin="5" Content="limX"
|
||||||
|
Background="DodgerBlue"/>
|
||||||
|
<Button Grid.Column="4" Margin="5" Content="limY"
|
||||||
|
Background="DodgerBlue"/>
|
||||||
|
<Button Grid.Column="5" Margin="5" Content="Edit"
|
||||||
|
Background="LightYellow"/>
|
||||||
|
<Button Grid.Column="6" Margin="5" Content="Delete"
|
||||||
|
Background="LightPink"/>
|
||||||
|
</Grid>
|
||||||
|
<lvc:CartesianChart Grid.Row="0" Grid.Column="1" Grid.RowSpan="2"
|
||||||
|
Series="{Binding SeriesCollection}" Margin="5">
|
||||||
|
<lvc:CartesianChart.AxisY>
|
||||||
|
<lvc:Axis Title="Y"></lvc:Axis>
|
||||||
|
</lvc:CartesianChart.AxisY>
|
||||||
|
<lvc:CartesianChart.AxisX>
|
||||||
|
<lvc:Axis Title="X" Labels="{Binding Labels}"></lvc:Axis>
|
||||||
|
</lvc:CartesianChart.AxisX>
|
||||||
|
</lvc:CartesianChart>
|
||||||
|
</Grid>
|
||||||
|
</Window>
|
||||||
28
StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs
Normal file
28
StructureHelper/Windows/TreeGraph/TreeGraph.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
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.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
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Interaction logic for TreeGraph.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class TreeGraph : Window
|
||||||
|
{
|
||||||
|
public TreeGraph()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs
Normal file
22
StructureHelper/Windows/TreeGraph/TreeGraphViewModel.cs
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
using NLog.Common;
|
||||||
|
using StructureHelper.Infrastructure;
|
||||||
|
using StructureHelperCommon.Infrastructures.Interfaces;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace StructureHelper.Windows.TreeGraph
|
||||||
|
{
|
||||||
|
public class TreeGraphViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
private List<IOneVariableFunction> nodes;
|
||||||
|
public List<IOneVariableFunction> Nodes { get; set; }
|
||||||
|
public TreeGraphViewModel(IOneVariableFunction function)
|
||||||
|
{
|
||||||
|
Nodes = new List<IOneVariableFunction>();
|
||||||
|
Nodes.Add(function);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -24,21 +24,21 @@
|
|||||||
</TypeIdentifier>
|
</TypeIdentifier>
|
||||||
</Interface>
|
</Interface>
|
||||||
<Interface Name="StructureHelperCommon.Models.Functions.IScaleFunction">
|
<Interface Name="StructureHelperCommon.Models.Functions.IScaleFunction">
|
||||||
<Position X="9" Y="3" Width="1.5" />
|
<Position X="7.75" Y="3" Width="1.5" />
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
<HashCode>AAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
<HashCode>AAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||||
<FileName>Models\Functions\IScaleFunction.cs</FileName>
|
<FileName>Models\Functions\IScaleFunction.cs</FileName>
|
||||||
</TypeIdentifier>
|
</TypeIdentifier>
|
||||||
</Interface>
|
</Interface>
|
||||||
<Interface Name="StructureHelperCommon.Models.Functions.ILimitFunction">
|
<Interface Name="StructureHelperCommon.Models.Functions.ILimitFunction">
|
||||||
<Position X="7.25" Y="3" Width="1.5" />
|
<Position X="5.75" Y="3" Width="1.5" />
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
<HashCode>AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
<HashCode>AAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||||
<FileName>Models\Functions\ILimitFunction.cs</FileName>
|
<FileName>Models\Functions\ILimitFunction.cs</FileName>
|
||||||
</TypeIdentifier>
|
</TypeIdentifier>
|
||||||
</Interface>
|
</Interface>
|
||||||
<Interface Name="StructureHelperCommon.Infrastructures.Interfaces.IFunctionDecorator">
|
<Interface Name="StructureHelperCommon.Infrastructures.Interfaces.IFunctionDecorator">
|
||||||
<Position X="8" Y="0.75" Width="1.5" />
|
<Position X="6.25" Y="0.5" Width="2.5" />
|
||||||
<TypeIdentifier>
|
<TypeIdentifier>
|
||||||
<HashCode>AAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
<HashCode>AAAAAAAAAAAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAA=</HashCode>
|
||||||
<FileName>Infrastructures\Interfaces\IFunctionDecorator.cs</FileName>
|
<FileName>Infrastructures\Interfaces\IFunctionDecorator.cs</FileName>
|
||||||
|
|||||||
@@ -9,8 +9,11 @@ namespace StructureHelperCommon.Infrastructures.Interfaces
|
|||||||
{
|
{
|
||||||
public interface IOneVariableFunction
|
public interface IOneVariableFunction
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public bool IsUser { get; set; }
|
||||||
public FunctionType Type { get; set; }
|
public FunctionType Type { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
public bool Check();
|
public bool Check();
|
||||||
public double GetByX(double xValue);
|
public double GetByX(double xValue);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ namespace StructureHelperCommon.Models.Functions
|
|||||||
{
|
{
|
||||||
public class FormulaFunction : IOneVariableFunction
|
public class FormulaFunction : IOneVariableFunction
|
||||||
{
|
{
|
||||||
|
public bool IsUser { get; set; }
|
||||||
public FunctionType Type { get; set; }
|
public FunctionType Type { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string Description { get ; set; }
|
||||||
|
|
||||||
public bool Check()
|
public bool Check()
|
||||||
{
|
{
|
||||||
@@ -25,8 +27,10 @@ namespace StructureHelperCommon.Models.Functions
|
|||||||
|
|
||||||
public class CopyOfFormulaFunction : IOneVariableFunction
|
public class CopyOfFormulaFunction : IOneVariableFunction
|
||||||
{
|
{
|
||||||
|
public bool IsUser { get; set; }
|
||||||
public FunctionType Type { get; set; }
|
public FunctionType Type { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
public bool Check()
|
public bool Check()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ namespace StructureHelperCommon.Models.Functions
|
|||||||
{
|
{
|
||||||
public class TableFunction : IOneVariableFunction
|
public class TableFunction : IOneVariableFunction
|
||||||
{
|
{
|
||||||
|
public bool IsUser { get; set; }
|
||||||
public FunctionType Type { get; set; }
|
public FunctionType Type { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
public bool Check()
|
public bool Check()
|
||||||
{
|
{
|
||||||
@@ -25,8 +27,10 @@ namespace StructureHelperCommon.Models.Functions
|
|||||||
|
|
||||||
public class CopyOfTableFunction : IOneVariableFunction
|
public class CopyOfTableFunction : IOneVariableFunction
|
||||||
{
|
{
|
||||||
|
public bool IsUser { get; set; }
|
||||||
public FunctionType Type { get; set; }
|
public FunctionType Type { get; set; }
|
||||||
public string Name { get; set; }
|
public string Name { get; set; }
|
||||||
|
public string Description { get; set; }
|
||||||
|
|
||||||
public bool Check()
|
public bool Check()
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net6.0-windows</TargetFramework>
|
<TargetFramework>net6.0-windows</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
@@ -34,5 +33,4 @@
|
|||||||
<Folder Include="FunctionalTests\RCs\Anchorage\" />
|
<Folder Include="FunctionalTests\RCs\Anchorage\" />
|
||||||
<Folder Include="UnitTests\WindowTests\Calculations\CalculationProperties\" />
|
<Folder Include="UnitTests\WindowTests\Calculations\CalculationProperties\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
Reference in New Issue
Block a user