| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- <UserControl x:Class="TeamAAS_VP.Views.Product.CreateProductPage"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:prism="http://prismlibrary.com/"
- xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
- xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
- 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.Product"
- xmlns:lex="http://wpflocalizeextension.codeplex.com"
- xmlns:sys="clr-namespace:System;assembly=mscorlib"
- lex:LocalizeDictionary.DesignCulture="zh-CN"
- lex:ResxLocalizationProvider.DefaultAssembly="TeamAAS-VP"
- lex:ResxLocalizationProvider.DefaultDictionary="Lang"
- prism:ViewModelLocator.AutoWireViewModel="True"
- mc:Ignorable="d"
- d:DataContext="{d:DesignInstance Type=vm:CreateProductPageViewModel}"
- Name="createpro"
- FontFamily="{DynamicResource DefaultFont}">
- <UserControl.Resources>
- <!-- Unified sizing and spacing -->
- <Thickness x:Key="OuterPadding">18</Thickness>
- <Thickness x:Key="ControlMargin">0,10,0,0</Thickness>
- <sys:Double x:Key="TitleFontSize">20</sys:Double>
- <sys:Double x:Key="ControlFontSize">15</sys:Double>
- <sys:Double x:Key="ControlHeight">44</sys:Double>
- <sys:Double x:Key="ControlMaxWidth">520</sys:Double>
- <CornerRadius x:Key="PanelCorner">10</CornerRadius>
- <!-- Button style based on MaterialDesign flat button but tuned -->
- <Style x:Key="ActionButtonStyle" TargetType="Button" BasedOn="{StaticResource MaterialDesignFlatButton}">
- <Setter Property="MinWidth" Value="110"/>
- <Setter Property="FontSize" Value="{StaticResource ControlFontSize}"/>
- <Setter Property="Padding" Value="12,6"/>
- </Style>
- </UserControl.Resources>
- <b:Interaction.Triggers>
- <b:EventTrigger EventName="Loaded">
- <b:InvokeCommandAction Command="{Binding LoadedCommand}" />
- </b:EventTrigger>
- </b:Interaction.Triggers>
- <Grid Background="Transparent">
- <Border Background="White"
- CornerRadius="{StaticResource PanelCorner}"
- Padding="20"
- HorizontalAlignment="Center"
- MaxWidth="{StaticResource ControlMaxWidth}"
- Effect="{DynamicResource MaterialDesignElevationShadow4}">
- <StackPanel HorizontalAlignment="Stretch">
- <TextBlock Text="{lex:Loc 新建产品}"
- FontSize="{StaticResource TitleFontSize}"
- FontWeight="SemiBold"
- Margin="0,0,0,8"/>
- <!-- Name input -->
- <TextBox x:Name="txtName"
- Margin="{StaticResource ControlMargin}"
- materialDesign:HintAssist.Hint="{lex:Loc 请输入产品名称}"
- materialDesign:HintAssist.IsFloating="True"
- FontSize="{StaticResource ControlFontSize}"
- Height="{StaticResource ControlHeight}"
- Style="{StaticResource MaterialDesignFloatingHintTextBox}"
- Text="{Binding ProductName,Mode=TwoWay}" />
- <!-- Template selection -->
- <ComboBox Margin="{StaticResource ControlMargin}"
- FontSize="{StaticResource ControlFontSize}"
- Height="{StaticResource ControlHeight}"
- materialDesign:HintAssist.Hint="{lex:Loc 模板}"
- materialDesign:HintAssist.IsFloating="True"
- materialDesign:HintAssist.HelperText="{lex:Loc 选择一个模板}"
- Style="{StaticResource MaterialDesignFloatingHintComboBox}"
- ItemsSource="{Binding Templates}"
- SelectedItem="{Binding SelectTemplate}"
- MaxWidth="{StaticResource ControlMaxWidth}" />
- <TextBlock Text="{lex:Loc 请填写产品名称并选择对应模板}"
- FontSize="12"
- Foreground="{DynamicResource MaterialDesignBodySecondary}"
- Margin="0,12,0,0"/>
- <StackPanel Orientation="Horizontal"
- HorizontalAlignment="Center"
- Margin="0,18,0,0">
- <Button FontSize="{StaticResource ControlFontSize}"
- Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
- CommandParameter="{Binding ElementName=createpro,Path=DataContext}"
- IsDefault="True"
- Style="{StaticResource ActionButtonStyle}"
- Content="{lex:Loc 确定}"
- Margin="0,0,12,0" />
- <Button Margin="0"
- FontSize="{StaticResource ControlFontSize}"
- Command="{x:Static materialDesign:DialogHost.CloseDialogCommand}"
- IsCancel="True"
- Style="{StaticResource ActionButtonStyle}"
- Content="{lex:Loc 取消}">
- <Button.CommandParameter>
- <x:Null />
- </Button.CommandParameter>
- </Button>
- </StackPanel>
- </StackPanel>
- </Border>
- </Grid>
- </UserControl>
|