XiangTan_JiaoJie_Bak/DM_Weight/Views/OpenBoxWindow.xaml

65 lines
3.9 KiB
XML

<UserControl x:Class="DM_Weight.Views.OpenBoxWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:DM_Weight.Views"
xmlns:prism="http://prismlibrary.com/"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:convert="clr-namespace:DM_Weight.Converter"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<convert:OpenBoxSelectConverter x:Key="OpenBoxSelectConverter" />
<convert:StatusConverter x:Key="StatusConverter" />
<convert:OpenStatusConverter x:Key="OpenStatusConverter" />
</UserControl.Resources>
<Grid>
<Grid.Resources>
<Style TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignPaperLightButton}">
<Setter Property="Foreground" Value="#00a0ea" />
<Setter Property="BorderBrush" Value="#00a0ea" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" />
</Trigger>
<DataTrigger Value="True">
<DataTrigger.Binding>
<MultiBinding Converter="{StaticResource OpenBoxSelectConverter}">
<Binding RelativeSource="{ RelativeSource Mode=Self }" Path="Content" />
<Binding Path="DrawerNo" />
</MultiBinding>
</DataTrigger.Binding>
<Setter Property="Background" Value="#d1e7f5" />
<Setter Property="BorderBrush" Value="#d1e7f5" />
</DataTrigger>
</Style.Triggers>
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="5*"/>
<ColumnDefinition Width="5*"/>
</Grid.ColumnDefinitions>
<materialDesign:Card Grid.Column="0" Foreground="{DynamicResource PrimaryHueLightForegroundBrush}" Padding="8">
<Button Width="120" Content="{Binding SelfContent}" Command="{Binding OpenBoxDelegate}" CommandParameter="0"
IsEnabled="{Binding SelfEnable}"
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding PublicStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding PublicStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
Style="{StaticResource MaterialDesignOutlinedLightButton}"/>
</materialDesign:Card>
<materialDesign:Card Grid.Column="1" Foreground="{DynamicResource PrimaryHueLightForegroundBrush}" Padding="8">
<Button Width="120" Content="{Binding PublicContent}" Command="{Binding OpenBoxDelegate}" CommandParameter="1"
IsEnabled="{Binding PublicEnable}"
materialDesign:ButtonProgressAssist.IsIndicatorVisible="{Binding SelfStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
materialDesign:ButtonProgressAssist.IsIndeterminate="{Binding SelfStatus, Converter={StaticResource StatusConverter}, ConverterParameter=opearBtnLoading}"
Style="{StaticResource MaterialDesignOutlinedLightButton}"/>
</materialDesign:Card>
</Grid>
</UserControl>