You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

95 lines
6.7 KiB

<tool:BaseDialog x:Class="Gumming.UnitViewFormulaView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Gumming"
xmlns:tool="clr-namespace:GummingCommon;assembly=GummingCommon"
Background="{DynamicResource DefaultWindowBackground}"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
Title="MainWindow" Width="500" Height="450" Icon="/Gumming;component/Resource/Logo.ico" WindowStartupLocation="CenterScreen">
<Window.Resources>
<tool:BooleanToVisibilityConverter x:Key="BooleanConverter"/>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Margin" Value="3"/>
<Setter Property="VerticalAlignment" Value="Top"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
</Style>
<Style TargetType="{x:Type ListBox}">
<Setter Property="Background" Value="White"/>
<Setter Property="Margin" Value="2"/>
</Style>
</Window.Resources>
<Grid Background="Transparent">
<Border CornerRadius="3" BorderBrush="Transparent" BorderThickness="1" Background="Transparent">
<Border CornerRadius="1" BorderThickness="1" Background="Transparent" Height="Auto" BorderBrush="{DynamicResource DialogInnerBorder}">
<Grid Margin="10,10,10,10">
<Grid.RowDefinitions>
<RowDefinition Height="36"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="35"></RowDefinition>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="{Binding ProductTitle}"></TextBlock>
<Button Command="{Binding CancelCommand}" Cursor="Hand" Margin="0,6,10,0" VerticalAlignment="Top" HorizontalAlignment="Right" Grid.Column="1" Style="{DynamicResource btnCloseStyle}" Width="26" Height="26" x:Name="btnWinClose" Focusable="False"></Button>
<Grid Grid.Row="1" Margin="5">
<Grid.RowDefinitions>
<RowDefinition Height="30"></RowDefinition>
<RowDefinition Height="10"></RowDefinition>
<RowDefinition Height="*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="10"></ColumnDefinition>
<ColumnDefinition Width="*"></ColumnDefinition>
</Grid.ColumnDefinitions>
<ListBox Grid.Column="0" Grid.Row="2" tool:TouchScrolling.IsEnabled="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" PreviewKeyDown="listBox_PreviewKeyDown" x:Name="LstFormulaType" Background="Transparent" BorderBrush="{DynamicResource ButtonBrush9}" BorderThickness="1" ItemsSource="{Binding FormulaTypes}" SelectedItem="{Binding SelectedFormulaType, Mode=TwoWay}" ItemContainerStyle="{DynamicResource PatternListBoxItem}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock TextAlignment="Left" VerticalAlignment="Center" Text="{Binding StationName}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<TextBlock Text="{Binding StationName}"></TextBlock>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<tool:ExecuteCommandAction Command="{Binding SelectFormulaTypeCommand}" CommandParameter="{Binding SelectedItem,ElementName=LstFormulaType}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
<ListBox Grid.Column="2" Grid.Row="2" tool:TouchScrolling.IsEnabled="True" ScrollViewer.HorizontalScrollBarVisibility="Disabled" PreviewKeyDown="listBox_PreviewKeyDown" x:Name="LstFormula" Background="Transparent" BorderBrush="{DynamicResource ButtonBrush9}" BorderThickness="1" ItemsSource="{Binding HardFormulas}" SelectedItem="{Binding SelectedFormula, Mode=TwoWay}" ItemContainerStyle="{DynamicResource PatternListBoxItem}" Height="500" VerticalAlignment="Top">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock TextAlignment="Left" VerticalAlignment="Center" Text="{Binding FormulaName}" TextTrimming="CharacterEllipsis">
<TextBlock.ToolTip>
<TextBlock Text="{Binding FormulaName}"></TextBlock>
</TextBlock.ToolTip>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<tool:ExecuteCommandAction Command="{Binding SelectFormulaCommand}" CommandParameter="{Binding SelectedItem,ElementName=LstFormula}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
</Grid>
<Grid Grid.Column="1" Grid.Row="4">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="80"></ColumnDefinition>
<ColumnDefinition Width="5"></ColumnDefinition>
</Grid.ColumnDefinitions>
<Button Grid.Column="2" Margin="2" Style="{DynamicResource CommonIconButton}" Command="{Binding SaveCommand}" Content="确定"></Button>
<Button Grid.Column="3" Margin="2" Style="{DynamicResource CommonIconButton}" Command="{Binding CancelCommand}" Content="取消"></Button>
</Grid>
</Grid>
</Border>
</Border>
</Grid>
</tool:BaseDialog>