207 lines
8.4 KiB
XML
207 lines
8.4 KiB
XML
<Window x:Class="StructureHelper.Windows.MainGraph.FormulaView"
|
|
x:Name="FormulaFunction_win"
|
|
xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
|
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"
|
|
xmlns:ens="clr-namespace:StructureHelperCommon.Infrastructures.Enums;assembly=StructureHelperCommon"
|
|
mc:Ignorable="d"
|
|
d:DataContext="{d:DesignInstance local:FormulaViewModel}"
|
|
Title="FormulaFunction" Height="640" Width="400">
|
|
<Window.Resources>
|
|
<ObjectDataProvider x:Key="PurposeEnum" MethodName="GetValues"
|
|
ObjectType="{x:Type sys:Enum}">
|
|
<ObjectDataProvider.MethodParameters>
|
|
<x:Type TypeName="ens:FunctionPurpose"/>
|
|
</ObjectDataProvider.MethodParameters>
|
|
</ObjectDataProvider>
|
|
</Window.Resources>
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="60"/>
|
|
<RowDefinition Height="*"/>
|
|
<RowDefinition Height="150"/>
|
|
<RowDefinition Height="60"/>
|
|
<RowDefinition Height="60"/>
|
|
<RowDefinition Height="60"/>
|
|
<RowDefinition Height="60"/>
|
|
<RowDefinition Height="60"/>
|
|
<RowDefinition Height="50"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Margin="5"
|
|
Text="Formula:"
|
|
VerticalAlignment="Center"/>
|
|
<Grid Grid.Row="1">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="50"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0" Text="y(x) ="
|
|
Margin="5"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Right"/>
|
|
<TextBox Grid.Column="1" Text="{Binding Formula, UpdateSourceTrigger=PropertyChanged}"
|
|
Margin="5"/>
|
|
</Grid>
|
|
</Grid>
|
|
<TextBlock Grid.Row="1"
|
|
Margin="5"
|
|
Background="LightYellow"
|
|
Text="{Binding FormulaText, UpdateSourceTrigger=PropertyChanged}"
|
|
TextAlignment="Center"
|
|
FontSize="20"
|
|
TextWrapping="Wrap">
|
|
</TextBlock>
|
|
<Grid Grid.Row="2">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="90"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid Grid.Row="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="20"/>
|
|
<ColumnDefinition Width="10"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Row="0" Grid.ColumnSpan="3"
|
|
Margin="5"
|
|
Text="Enter limit bounds:"
|
|
VerticalAlignment="Center"/>
|
|
<TextBlock Grid.Column="0"
|
|
Grid.Row="1"
|
|
Text="{Binding X}"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Right"/>
|
|
<TextBlock Grid.Column="1"
|
|
Grid.Row="1"
|
|
Text="{Binding GREATER}"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Right"/>
|
|
<TextBox Grid.Column="2"
|
|
Grid.Row="1"
|
|
Text="{Binding LeftBound,
|
|
UpdateSourceTrigger=PropertyChanged,
|
|
StringFormat=\{0:n\}}"
|
|
Margin="5"/>
|
|
<TextBlock Grid.Column="0"
|
|
Grid.Row="2"
|
|
Text="{Binding X}"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Right"/>
|
|
<TextBlock Grid.Column="1"
|
|
Grid.Row="2"
|
|
Text="{Binding LESS}"
|
|
VerticalAlignment="Center"
|
|
HorizontalAlignment="Right"/>
|
|
<TextBox Grid.Column="2"
|
|
Grid.Row="2"
|
|
Text="{Binding RightBound,
|
|
UpdateSourceTrigger=PropertyChanged,
|
|
StringFormat=\{0:n\}}"
|
|
Margin="5"/>
|
|
</Grid>
|
|
<TextBlock Grid.Row="1"
|
|
Margin="5"
|
|
Background="LightYellow"
|
|
Text="{Binding LimitText, UpdateSourceTrigger=PropertyChanged}"
|
|
TextAlignment="Center"
|
|
FontSize="20"
|
|
TextWrapping="Wrap">
|
|
</TextBlock>
|
|
</Grid>
|
|
<Grid Grid.Row="3">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Margin="5"
|
|
Text="Step:"
|
|
VerticalAlignment="Center"/>
|
|
<TextBox Grid.Row="1" Text="{Binding Step}" Margin="5"/>
|
|
</Grid>
|
|
<Grid Grid.Row="4">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Margin="5"
|
|
Text="Name:"
|
|
VerticalAlignment="Center"/>
|
|
<TextBox Grid.Row="1" Text="{Binding Name}" Margin="5"/>
|
|
</Grid>
|
|
<Grid Grid.Row="5">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Margin="5"
|
|
Text="Purpose:"
|
|
VerticalAlignment="Center"/>
|
|
<ComboBox Grid.Row="1"
|
|
Margin="5"
|
|
ItemsSource="{Binding Source={StaticResource PurposeEnum}}"
|
|
SelectedItem="{Binding FunctionPurpose}"/>
|
|
</Grid>
|
|
<Grid Grid.Row="6">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0"
|
|
Margin="5"
|
|
Text="Description:"
|
|
VerticalAlignment="Center"/>
|
|
<TextBox Grid.Row="1" Text="{Binding Description}" Margin="5"/>
|
|
</Grid>
|
|
<Grid Grid.Row="7">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="30"/>
|
|
<RowDefinition Height="30"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="*"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock
|
|
Grid.Row="0"
|
|
Margin="5"
|
|
Text="Color:"
|
|
VerticalAlignment="Center"/>
|
|
<Button Grid.Row="1"
|
|
Grid.Column="1"
|
|
Margin="5,5,5,5"
|
|
Command="{Binding EditColorCommand}"
|
|
Content="Press to change color">
|
|
</Button>
|
|
<Rectangle
|
|
Grid.Row="1"
|
|
Grid.Column="0"
|
|
Margin="5,5,5,5">
|
|
<Rectangle.Fill>
|
|
<SolidColorBrush Color="{Binding Color, UpdateSourceTrigger=PropertyChanged}"/>
|
|
</Rectangle.Fill>
|
|
</Rectangle>
|
|
</Grid>
|
|
<Button Grid.Row="8" Margin="5" Content="Save"
|
|
Command="{Binding SaveCommand}"
|
|
CommandParameter="{Binding ElementName=FormulaFunction_win}">
|
|
</Button>
|
|
</Grid>
|
|
</Window>
|