| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- <Window x:Class="MuchInfo.Chart.FormulaEdit.ParamsSetPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:Themes="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Classic"
- xmlns:formulaEdit="clr-namespace:MuchInfo.Chart.FormulaEdit"
- Title="参数设置"
- Width="450"
- Height="319"
- Foreground="{DynamicResource MuchinfoBrush6}"
- Icon="Image/fsSelect.ico"
- ResizeMode="NoResize"
- WindowStartupLocation="CenterOwner">
- <Window.Resources>
- <DataTemplate x:Key="ParamsTemplate">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="2*" />
- <ColumnDefinition Width="3*" />
- </Grid.ColumnDefinitions>
- <TextBlock Margin="5,0"
- HorizontalAlignment="Right"
- Text="{Binding Key}" />
- <formulaEdit:NumberTextBox Grid.Column="1" Text="{Binding Value.Value, Mode=TwoWay}" />
- </Grid>
- </DataTemplate>
- <Style x:Key="ParamInputStyle" TargetType="{x:Type ListBox}">
- <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" />
- <Setter Property="BorderThickness" Value="2" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
- <Setter Property="ScrollViewer.PanningMode" Value="Both" />
- <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ScrollViewer>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsGrouping" Value="true" />
- </MultiTrigger.Conditions>
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ParamEditItemStyle" TargetType="{x:Type ListBoxItem}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="HorizontalContentAlignment" Value="Stretch" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Padding" Value="2,5" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Padding="{TemplateBinding Padding}"
- SnapsToDevicePixels="true">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ListBoxStyle1" TargetType="{x:Type ListBox}">
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush13}" />
- <Setter Property="BorderBrush" Value="{DynamicResource MuchinfoBrush6}" />
- <Setter Property="BorderThickness" Value="2" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBox}">
- <Border x:Name="Bd"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- SnapsToDevicePixels="true">
- <ScrollViewer Focusable="false" Padding="{TemplateBinding Padding}">
- <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ScrollViewer>
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="Bd" Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" />
- </Trigger>
- <Trigger Property="IsGrouping" Value="true">
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="ListBoxItemStyle1" TargetType="{x:Type ListBoxItem}">
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
- <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
- <Setter Property="Padding" Value="2,0,0,0" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ListBoxItem}">
- <Border x:Name="Bd"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- Padding="{TemplateBinding Padding}"
- SnapsToDevicePixels="true">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsSelected" Value="true">
- <Setter TargetName="Bd" Property="Background" Value="{DynamicResource MuchinfoBrush49}" />
- <Setter Property="Foreground" Value="{DynamicResource MuchinfoBrush3}" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsSelected" Value="true" />
- <Condition Property="Selector.IsSelectionActive" Value="false" />
- </MultiTrigger.Conditions>
- </MultiTrigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </Window.Resources>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition />
- <RowDefinition Height="50" />
- </Grid.RowDefinitions>
- <TextBlock Margin="10,5" Text="公式名称" />
- <ListBox x:Name="lboxFormula"
- Grid.Row="1"
- Margin="10,0"
- DisplayMemberPath="Name"
- ItemContainerStyle="{DynamicResource ListBoxItemStyle1}"
- ItemsSource="{Binding ProgramModels}"
- SelectedItem="{Binding SelectProgramModel}"
- Style="{DynamicResource ListBoxStyle1}" />
- <TextBlock Grid.Column="1"
- Margin="0,5"
- Text="参数设置" />
- <ListBox Grid.Row="1"
- Grid.Column="1"
- ItemContainerStyle="{DynamicResource ParamEditItemStyle}"
- ItemTemplate="{DynamicResource ParamsTemplate}"
- ItemsSource="{Binding SelectedItem.CustomParams,
- ElementName=lboxFormula}"
- Style="{DynamicResource ParamInputStyle}" />
- <Button Grid.Row="1"
- Grid.Column="2"
- Margin="10,5"
- VerticalAlignment="Center"
- Click="btnEditFormula_OnClick"
- Content="编辑公式"
- Style="{DynamicResource CommonButtonStyle}" />
- <Button Grid.Row="2"
- Grid.Column="1"
- MinWidth="80"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Click="ButtonBase_OnClick"
- Command="{Binding ConfirmCommand}"
- Content="确定"
- Style="{DynamicResource CommonButtonStyle}" />
- <Button Grid.Row="2"
- Grid.Column="2"
- MinWidth="80"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Click="btnCancel_OnClick"
- Content="取消"
- Style="{DynamicResource CommonButtonStyle}" />
- </Grid>
- </Window>
|