math-suite/Source/Factorizator/MainWindow.xaml

112 lines
4.9 KiB
Plaintext
Raw Normal View History

2018-02-05 23:24:46 +00:00
<Window x:Class="Factorizator.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Factorizator" Height="355" Width="365"
KeyDown="Window_KeyDown" Icon="/Factorizator;component/factorizator-logo.ico">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Styles/ButtonStyle.xaml" />
<ResourceDictionary Source="/Styles/GroupBoxStyle.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Window.Resources>
<Window.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint=".5,1">
<GradientStop Color="#EEE" Offset="0" />
<GradientStop Color="#BBB" Offset="1" />
</LinearGradientBrush>
</Window.Background>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<GroupBox Header="Input number">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox Name="inputNumber" Grid.Column="0" TextChanged="inputNumber_TextChanged" />
<Button Name="buttonCalculate" Grid.Column="1" Width="64" Click="buttonCalculate_Click">Calculate</Button>
</Grid>
</GroupBox>
<GroupBox Header="Factorization" Grid.Row="1">
<ListView Name="factorizationDisplay" BorderBrush="#ABC" HorizontalContentAlignment="Stretch">
<ListView.View>
<GridView AllowsColumnReorder="False">
<GridViewColumn Header="Remainder" DisplayMemberBinding="{Binding FirstString}" Width="165"/>
<GridViewColumn Header="Divisor" DisplayMemberBinding="{Binding SecondString}" Width="140"/>
</GridView>
</ListView.View>
<ListView.ContextMenu>
<ContextMenu>
<MenuItem Name="contextCopyRem" Header="Copy remainder" InputGestureText="Ctrl+C" Click="contextCopyRem_Click"/>
<MenuItem Name="contextCopyDiv" Header="Copy divisor" InputGestureText="Ctrl+Shift+C" Click="contextCopyDiv_Click"/>
<Separator />
<MenuItem Name="contextClear" Header="Clear" Click="contextClear_Click"/>
</ContextMenu>
</ListView.ContextMenu>
</ListView>
</GroupBox>
<StatusBar Grid.Row="2">
<StatusBar.Background>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Color="#80FFFFFF" Offset="0" />
<GradientStop Color="#30FFFFFF" Offset="1" />
</LinearGradientBrush>
</StatusBar.Background>
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem>
<TextBlock Name="statusMessage" Grid.Column="0">Ready</TextBlock>
</StatusBarItem>
<StatusBarItem Grid.Column="1">
<ProgressBar Name="statusProgress"
Height="12" Width="60"
IsIndeterminate="True"
Visibility="Hidden" />
</StatusBarItem>
<StatusBarItem Grid.Column="2">
<Button Name="statusCancel" Click="statusCancel_Click"
Style="{StaticResource ButtonSmallStyle}"
Width="50"
Visibility="Hidden" >Cancel</Button>
</StatusBarItem>
<StatusBarItem Grid.Column="3">
<TextBlock Foreground="Blue" TextDecorations="Underline"
MouseUp="TextBlock_MouseUp" >Help</TextBlock>
</StatusBarItem>
</StatusBar>
</Grid>
</Window>