子程序使用优化
This commit is contained in:
@@ -8,11 +8,26 @@
|
||||
xmlns:behaviors="clr-namespace:UIShare.Behaviors;assembly=UIShare"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:prism="http://prismlibrary.com/"
|
||||
xmlns:converters="clr-namespace:UIShare.Converters;assembly=UIShare"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
<UserControl.Resources>
|
||||
<converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter"/>
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<GroupBox Header="{Binding Title}">
|
||||
<DockPanel>
|
||||
<!-- 面包屑导航栏 -->
|
||||
<Border DockPanel.Dock="Top" Background="#F0F0F0" Padding="6,3" Visibility="{Binding CanGoBack, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<DockPanel>
|
||||
<Button DockPanel.Dock="Right" Content="↩ 返回上一级"
|
||||
Command="{Binding GoBackCommand}"
|
||||
Style="{StaticResource MaterialDesignFlatButton}"
|
||||
FontSize="12" Padding="8,2" Margin="8,0,0,0"/>
|
||||
<TextBlock Text="{Binding BreadcrumbPath}" VerticalAlignment="Center" FontSize="12" Foreground="#555"/>
|
||||
</DockPanel>
|
||||
</Border>
|
||||
<TabControl SelectedIndex="{Binding SelectedTabIndex, Mode=TwoWay}">
|
||||
<i:Interaction.Behaviors>
|
||||
<behaviors:TabControlSelectionChangedBehavior Command="{Binding TabSelectionChangedCommand}"
|
||||
@@ -29,7 +44,7 @@
|
||||
Background="Transparent"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
ItemsSource="{Binding Program.StepCollection}"
|
||||
ItemsSource="{Binding CurrentProgram.StepCollection}"
|
||||
SelectedItem="{Binding SelectedStep, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectionMode="Extended"
|
||||
SelectionUnit="FullRow">
|
||||
@@ -120,6 +135,9 @@
|
||||
<MenuItem Header="删除"
|
||||
Foreground="Red"
|
||||
Command="{Binding DeleteStepCommand}" />
|
||||
<Separator/>
|
||||
<MenuItem Header="打开子程序"
|
||||
Command="{Binding OpenSubProgramCommand}" />
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
|
||||
@@ -135,7 +153,7 @@
|
||||
Background="Transparent"
|
||||
CanUserAddRows="False"
|
||||
CanUserSortColumns="False"
|
||||
ItemsSource="{Binding Program.ErrorStepCollection}"
|
||||
ItemsSource="{Binding CurrentProgram.ErrorStepCollection}"
|
||||
SelectedItem="{Binding SelectedStep, Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
|
||||
SelectionMode="Extended"
|
||||
SelectionUnit="FullRow">
|
||||
@@ -226,21 +244,16 @@
|
||||
<MenuItem Header="删除"
|
||||
Foreground="Red"
|
||||
Command="{Binding DeleteStepCommand}" />
|
||||
<Separator/>
|
||||
<MenuItem Header="打开子程序"
|
||||
Command="{Binding OpenSubProgramCommand}" />
|
||||
</ContextMenu>
|
||||
</DataGrid.ContextMenu>
|
||||
|
||||
<!-- 键盘 删除键绑定 Delete 命令 -->
|
||||
<!--<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="PreviewKeyDown">
|
||||
<i:InvokeCommandAction Command="{Binding DeleteStepCommand}"
|
||||
CommandParameter="{Binding SelectedStep}"
|
||||
PassEventArgsToCommand="True" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>-->
|
||||
|
||||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</GroupBox>
|
||||
|
||||
</Grid>
|
||||
|
||||
Reference in New Issue
Block a user