127 lines
6.7 KiB
XML
127 lines
6.7 KiB
XML
<Window x:Class="StructureHelper.Windows.MainGraph.GraphView"
|
|
x:Name="GraphView_win"
|
|
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.MainGraph"
|
|
Loaded="Window_Loaded"
|
|
mc:Ignorable="d"
|
|
d:DataContext="{d:DesignInstance local:GraphViewModel}"
|
|
Title="StructureHelper" Height="700"
|
|
Width="1000"
|
|
MinHeight="400"
|
|
MinWidth="600">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="300"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="100"/>
|
|
</Grid.RowDefinitions>
|
|
<ListView Name="FunctionList"
|
|
Grid.Row="0" Grid.Column="0" Margin="5"
|
|
ItemsSource="{Binding Functions, UpdateSourceTrigger=PropertyChanged}"
|
|
SelectedItem="{Binding SelectedFuntion, UpdateSourceTrigger=PropertyChanged}">
|
|
<ListView.GroupStyle>
|
|
<GroupStyle>
|
|
<GroupStyle.HeaderTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Name, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"/>
|
|
</DataTemplate>
|
|
</GroupStyle.HeaderTemplate>
|
|
<GroupStyle.ContainerStyle>
|
|
<Style TargetType="{x:Type GroupItem}">
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate>
|
|
<Expander IsExpanded="True">
|
|
<Expander.Header>
|
|
<StackPanel Orientation="Horizontal">
|
|
<TextBlock Text="{Binding Name}" FontWeight="Bold"
|
|
Foreground="DarkSlateBlue"
|
|
VerticalAlignment="Bottom"/>
|
|
<TextBlock Text=": " FontWeight="Bold"
|
|
Foreground="DarkSlateBlue"
|
|
VerticalAlignment="Bottom"/>
|
|
<TextBlock Text="{Binding ItemCount}" FontWeight="Bold"
|
|
Foreground="Gray"
|
|
VerticalAlignment="Bottom" />
|
|
</StackPanel>
|
|
</Expander.Header>
|
|
<ItemsPresenter/>
|
|
</Expander>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</GroupStyle.ContainerStyle>
|
|
</GroupStyle>
|
|
</ListView.GroupStyle>
|
|
<ListView.ItemTemplate>
|
|
<DataTemplate>
|
|
<TextBlock Text="{Binding Path=Name, UpdateSourceTrigger=PropertyChanged}"/>
|
|
</DataTemplate>
|
|
</ListView.ItemTemplate>
|
|
</ListView>
|
|
<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"
|
|
Command="{Binding AddTableCommand}"
|
|
Background="LightGreen"/>
|
|
<Button Grid.Column="0" Grid.Row="1" Margin="5" Content="Add formula"
|
|
Command="{Binding AddFormulaCommand}"
|
|
Background="LightGreen"/>
|
|
<Button Grid.Column="1" Grid.Row="0" Margin="5" Content="Edit"
|
|
Command="{Binding EditCommand}"
|
|
CommandParameter="{Binding ElementName=GraphView_win}"
|
|
IsEnabled="{Binding SelectedFuntion.IsUser, UpdateSourceTrigger=PropertyChanged}"
|
|
Background="LightYellow"/>
|
|
<Button Grid.Column="1" Grid.Row="1" Margin="5" Content="Delete"
|
|
Command="{Binding DeleteCommand}"
|
|
IsEnabled="{Binding SelectedFuntion.IsUser, UpdateSourceTrigger=PropertyChanged}"
|
|
Background="LightPink"/>
|
|
<Button Grid.Column="2" Grid.Row="0" Margin="5" Content="Copy"
|
|
Command="{Binding CopyCommand}"
|
|
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, UpdateSourceTrigger=PropertyChanged}" Margin="5"
|
|
Zoom="Xy">
|
|
<lvc:CartesianChart.AxisY>
|
|
<lvc:Axis Title="Y"></lvc:Axis>
|
|
</lvc:CartesianChart.AxisY>
|
|
<lvc:CartesianChart.AxisX>
|
|
<lvc:Axis Title="X" Labels="{Binding Labels, UpdateSourceTrigger=PropertyChanged}"></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"
|
|
Name="DescriptionTextBlock"
|
|
Text="{Binding SelectedFuntion.Description}"
|
|
Margin="5" TextWrapping="Wrap"
|
|
VerticalAlignment="Center" Height="60"/>
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|