| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- <UserControl x:Class="TeamAAS_VP.Views.DebugMod.InchingControl"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.DebugMod"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- xmlns:enums="clr-namespace:TeamAAS_VP.Enums"
- xmlns:localview="clr-namespace:TeamAAS_VP.Views.DebugMod"
- xmlns:lex="http://wpflocalizeextension.codeplex.com"
- lex:LocalizeDictionary.DesignCulture="zh-CN"
- lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
- lex:ResxLocalizationProvider.DefaultDictionary="Lang"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d"
- d:Background="White"
- d:DataContext="{d:DesignInstance Type=vm:InchingControlViewModel}"
- FontFamily="{DynamicResource DefaultFont}">
- <b:Interaction.Triggers>
- <b:EventTrigger EventName="Loaded">
- <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
- </b:EventTrigger>
- </b:Interaction.Triggers>
-
- <Grid Margin="10,0,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
- <StackPanel Orientation="Horizontal"
- IsEnabled="{Binding IsAllowEdit}">
- <Button Content="{materialDesign:PackIcon Kind=AddBold}"
- Margin="10"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- Command="{Binding AddCommand}" />
- <Button Content="{materialDesign:PackIcon Kind=ContentSaveAll}"
- Margin="10"
- Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
- Command="{Binding SaveCommand}" />
- </StackPanel>
- <ItemsControl Grid.Row="1"
- ItemsSource="{Binding UserInchingCollection}">
- <ItemsControl.ItemsPanel>
- <ItemsPanelTemplate>
- <WrapPanel Orientation="Horizontal" />
- </ItemsPanelTemplate>
- </ItemsControl.ItemsPanel>
- <ItemsControl.ItemTemplate>
- <DataTemplate>
- <Button materialDesign:ButtonAssist.CornerRadius="10"
- ToolTip="{Binding Name}"
- Margin="10"
- Command="{Binding DataContext.InchingCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=localview:InchingControl}}"
- CommandParameter="{Binding}"
- Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=localview:InchingControl}, Path=DataContext}">
- <TextBlock Text="{Binding Name}" />
- <Button.ContextMenu>
- <ContextMenu DataContext="{Binding RelativeSource={RelativeSource Self}, Path=PlacementTarget.Tag}"
- IsEnabled="{Binding IsAllowEdit}">
- <MenuItem Header="{lex:Loc 移除}"
- Command="{Binding RemoveCommand}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
- Icon="{materialDesign:PackIcon Kind=Remove}" />
- <Separator />
- <MenuItem Header="{lex:Loc 编辑}"
- Command="{Binding EditCommand}"
- CommandParameter="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=ContextMenu}, Path=PlacementTarget.DataContext}"
- Icon="{materialDesign:PackIcon Kind=Edit}" />
- </ContextMenu>
- </Button.ContextMenu>
- <Button.Style>
- <Style TargetType="Button"
- BasedOn="{StaticResource MaterialDesignRaisedButton}">
- <Style.Triggers>
- <DataTrigger Binding="{Binding State}" Value="True">
- <Setter Property="Background"
- Value="Green" />
- </DataTrigger>
- <DataTrigger Binding="{Binding State}"
- Value="False">
- <Setter Property="Background"
- Value="DarkRed" />
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </Button.Style>
- </Button>
- </DataTemplate>
- </ItemsControl.ItemTemplate>
- </ItemsControl>
- </Grid>
- </UserControl>
|