|
@@ -0,0 +1,135 @@
|
|
|
|
|
+<UserControl x:Class="TeamAAS_VP.Views.Setting.AddLightController"
|
|
|
|
|
+ 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: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:valRules="clr-namespace:TeamAAS_VP.Identity"
|
|
|
|
|
+ xmlns:ext="clr-namespace:TeamAAS_VP.Extension"
|
|
|
|
|
+ xmlns:c="clr-namespace:TeamAAS_VP.ValueConverter"
|
|
|
|
|
+ xmlns:lex="http://wpflocalizeextension.codeplex.com"
|
|
|
|
|
+ xmlns:vm="clr-namespace:TeamAAS_VP.ViewModels.Setting"
|
|
|
|
|
+ xmlns:coreLights="clr-namespace:TeamAAS_VP.Core.Lights"
|
|
|
|
|
+ lex:LocalizeDictionary.DesignCulture="zh-CN"
|
|
|
|
|
+ lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
|
|
|
|
|
+ lex:ResxLocalizationProvider.DefaultDictionary="Lang"
|
|
|
|
|
+ mc:Ignorable="d"
|
|
|
|
|
+ d:Background="White"
|
|
|
|
|
+ d:DataContext="{d:DesignInstance Type=vm:AddLightControllerViewModel}"
|
|
|
|
|
+ prism:ViewModelLocator.AutoWireViewModel="True"
|
|
|
|
|
+ FontFamily="{DynamicResource DefaultFont}">
|
|
|
|
|
+ <prism:Dialog.WindowStyle>
|
|
|
|
|
+ <Style TargetType="Window">
|
|
|
|
|
+ <Setter Property="prism:Dialog.WindowStartupLocation"
|
|
|
|
|
+ Value="CenterScreen" />
|
|
|
|
|
+ <Setter Property="WindowStyle"
|
|
|
|
|
+ Value="None" />
|
|
|
|
|
+ <Setter Property="AllowDrop"
|
|
|
|
|
+ Value="True" />
|
|
|
|
|
+ <Setter Property="BorderThickness"
|
|
|
|
|
+ Value="0" />
|
|
|
|
|
+ <Setter Property="ShowInTaskbar"
|
|
|
|
|
+ Value="False" />
|
|
|
|
|
+ <Setter Property="SizeToContent"
|
|
|
|
|
+ Value="WidthAndHeight" />
|
|
|
|
|
+ <Setter Property="WindowState"
|
|
|
|
|
+ Value="Normal" />
|
|
|
|
|
+ <Setter Property="Topmost"
|
|
|
|
|
+ Value="True" />
|
|
|
|
|
+ </Style>
|
|
|
|
|
+ </prism:Dialog.WindowStyle>
|
|
|
|
|
+
|
|
|
|
|
+ <Grid HorizontalAlignment="Center">
|
|
|
|
|
+ <Grid.RowDefinitions>
|
|
|
|
|
+ <RowDefinition Height="*" />
|
|
|
|
|
+ <RowDefinition Height="50" />
|
|
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
|
+
|
|
|
|
|
+ <Grid Margin="20,20">
|
|
|
|
|
+ <Grid.RowDefinitions>
|
|
|
|
|
+ <RowDefinition />
|
|
|
|
|
+ <RowDefinition />
|
|
|
|
|
+ <RowDefinition />
|
|
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
|
+ <ColumnDefinition Width="50*" />
|
|
|
|
|
+ <ColumnDefinition Width="50*" />
|
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
|
+
|
|
|
|
|
+ <TextBlock Text="Id: "
|
|
|
|
|
+ Grid.Row="0"
|
|
|
|
|
+ Grid.Column="0"
|
|
|
|
|
+ Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
|
|
|
|
|
+ HorizontalAlignment="Right"
|
|
|
|
|
+ VerticalAlignment="Center" />
|
|
|
|
|
+ <TextBlock x:Name="txt_Id"
|
|
|
|
|
+ Text="{Binding LightController.Id,Mode=TwoWay}"
|
|
|
|
|
+ Grid.Row="0"
|
|
|
|
|
+ Grid.Column="1"
|
|
|
|
|
+ Margin="10,5"
|
|
|
|
|
+ HorizontalAlignment="Left"
|
|
|
|
|
+ VerticalAlignment="Center" />
|
|
|
|
|
+
|
|
|
|
|
+ <TextBlock Text="{lex:Loc 名称,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
|
|
|
|
|
+ Grid.Row="1"
|
|
|
|
|
+ Grid.Column="0"
|
|
|
|
|
+ Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
|
|
|
|
|
+ HorizontalAlignment="Right"
|
|
|
|
|
+ VerticalAlignment="Center" />
|
|
|
|
|
+ <TextBox x:Name="txt_Name"
|
|
|
|
|
+ Grid.Row="1"
|
|
|
|
|
+ Grid.Column="1"
|
|
|
|
|
+ Margin="10,5"
|
|
|
|
|
+ Width="200"
|
|
|
|
|
+ TextAlignment="Center"
|
|
|
|
|
+ HorizontalAlignment="Left"
|
|
|
|
|
+ VerticalAlignment="Center">
|
|
|
|
|
+ <TextBox.Text>
|
|
|
|
|
+ <Binding Path="LightController.Name"
|
|
|
|
|
+ Mode="TwoWay">
|
|
|
|
|
+ <Binding.ValidationRules>
|
|
|
|
|
+ <valRules:NameValidationRule />
|
|
|
|
|
+ </Binding.ValidationRules>
|
|
|
|
|
+ </Binding>
|
|
|
|
|
+ </TextBox.Text>
|
|
|
|
|
+ </TextBox>
|
|
|
|
|
+
|
|
|
|
|
+ <TextBlock Text="{lex:Loc 型号,Converter={StaticResource StringFormatConverter},ConverterParameter='{}{0}: '}"
|
|
|
|
|
+ Grid.Row="2"
|
|
|
|
|
+ Grid.Column="0"
|
|
|
|
|
+ Style="{StaticResource MaterialDesignSubtitle1TextBlock}"
|
|
|
|
|
+ HorizontalAlignment="Right"
|
|
|
|
|
+ VerticalAlignment="Center" />
|
|
|
|
|
+ <ComboBox Grid.Row="2"
|
|
|
|
|
+ Grid.Column="1"
|
|
|
|
|
+ Margin="10,5"
|
|
|
|
|
+ Width="200"
|
|
|
|
|
+ SelectedItem="{Binding LightController.LightModel,Mode=TwoWay}"
|
|
|
|
|
+ ItemsSource="{ext:EnumBindingSource EnumType=coreLights:LightModel}"
|
|
|
|
|
+ HorizontalAlignment="Left" />
|
|
|
|
|
+ </Grid>
|
|
|
|
|
+
|
|
|
|
|
+ <StackPanel Grid.Row="1"
|
|
|
|
|
+ Orientation="Horizontal"
|
|
|
|
|
+ HorizontalAlignment="Right">
|
|
|
|
|
+ <Button Height="30"
|
|
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
|
|
+ ToolTip="{lex:Loc 确定}"
|
|
|
|
|
+ Command="{Binding ConfirmCommand}">
|
|
|
|
|
+ <TextBlock Text="{lex:Loc 确定}" />
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ <Button Height="30"
|
|
|
|
|
+ Margin="20,0"
|
|
|
|
|
+ materialDesign:ButtonAssist.CornerRadius="10"
|
|
|
|
|
+ Style="{StaticResource MaterialDesignRaisedButton}"
|
|
|
|
|
+ ToolTip="{lex:Loc 取消}"
|
|
|
|
|
+ Command="{Binding CancelCommand}">
|
|
|
|
|
+ <TextBlock Text="{lex:Loc 取消}" />
|
|
|
|
|
+ </Button>
|
|
|
|
|
+ </StackPanel>
|
|
|
|
|
+ </Grid>
|
|
|
|
|
+</UserControl>
|