Commit c6265fea authored by 潘栩锋's avatar 潘栩锋 🚴

1. 添加 在 button 内 Icon 的 style ,方便修改

2. 添加 GraphStyle, 用于统一全部 Graph 图表的风格
3. 添加 新的MenuMotion, 按钮的颜色,与DynArea.ControlState 绑定一起
4. 优化 FixGraph,PgFixAnalyze 的风格
5. 优化 AD盒输入授权码 的界面 修改风格
parent 65f73b68
...@@ -11,6 +11,27 @@ ...@@ -11,6 +11,27 @@
<!--标准图标按钮 内部为iconPacks的按键,下方可带文字 --> <!--标准图标按钮 内部为iconPacks的按键,下方可带文字 -->
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Base" >
<Setter Property="Width" Value="36"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Small" >
<Setter Property="Width" Value="25"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Large" >
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
<Style TargetType="iconPacks:PackIconMaterial" x:Key="Styles.Icon.Rectangle" >
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="VerticalAlignment" Value="Center"/>
</Style>
<Style TargetType="Button" x:Key="Styles.Button.Icon" BasedOn="{StaticResource Styles.Button.Empty}"> <Style TargetType="Button" x:Key="Styles.Button.Icon" BasedOn="{StaticResource Styles.Button.Empty}">
<Style.Resources> <Style.Resources>
<Style TargetType="TextBlock" > <Style TargetType="TextBlock" >
...@@ -21,12 +42,7 @@ ...@@ -21,12 +42,7 @@
<Setter Property="FontFamily" Value="Microsoft Sans Serif"/> <Setter Property="FontFamily" Value="Microsoft Sans Serif"/>
<Setter Property="Margin" Value="3"/> <Setter Property="Margin" Value="3"/>
</Style> </Style>
<Style TargetType="iconPacks:PackIconMaterial" > <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Base}"/>
<Setter Property="Width" Value="36"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</Style.Resources> </Style.Resources>
<Style.Setters> <Style.Setters>
<Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/> <Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
...@@ -38,11 +54,7 @@ ...@@ -38,11 +54,7 @@
<!--小型图标按钮 内部为iconPacks的按键,下方不带文字 --> <!--小型图标按钮 内部为iconPacks的按键,下方不带文字 -->
<Style TargetType="Button" x:Key="Styles.Button.Icon.Small" BasedOn="{StaticResource Styles.Button.Empty}"> <Style TargetType="Button" x:Key="Styles.Button.Icon.Small" BasedOn="{StaticResource Styles.Button.Empty}">
<Style.Resources> <Style.Resources>
<Style TargetType="iconPacks:PackIconMaterial" > <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Small}"/>
<Setter Property="Width" Value="25"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</Style.Resources> </Style.Resources>
<Style.Setters> <Style.Setters>
<Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/> <Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
...@@ -59,11 +71,7 @@ ...@@ -59,11 +71,7 @@
<Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.Text}"/> <Setter Property="Foreground" Value="{StaticResource MahApps.Brushes.Text}"/>
<Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center"/>
</Style> </Style>
<Style TargetType="iconPacks:PackIconMaterial" > <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Large}"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</Style.Resources> </Style.Resources>
<Style.Setters> <Style.Setters>
<Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/> <Setter Property="Foreground" Value="{StaticResource Brushes.Activity}"/>
...@@ -123,12 +131,7 @@ ...@@ -123,12 +131,7 @@
<Setter Property="BorderBrush" Value="Transparent"/> <Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Margin" Value="{StaticResource ControlMargin}"/> <Setter Property="Margin" Value="{StaticResource ControlMargin}"/>
<Style.Resources> <Style.Resources>
<Style TargetType="iconPacks:PackIconMaterial" > <Style TargetType="iconPacks:PackIconMaterial" BasedOn="{StaticResource Styles.Icon.Rectangle}"/>
<Setter Property="Width" Value="20"/>
<Setter Property="Height" Value="auto"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
</Style>
</Style.Resources> </Style.Resources>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>
\ No newline at end of file
...@@ -64,7 +64,7 @@ namespace FLY.Thick.Base.UI.CustomSection ...@@ -64,7 +64,7 @@ namespace FLY.Thick.Base.UI.CustomSection
/// <summary> /// <summary>
/// X轴间隔 /// X轴间隔
/// </summary> /// </summary>
public int XStep { get; set; } public int XStep { get; set; } = 5;
public UcSectionScanGraphVm() public UcSectionScanGraphVm()
{ {
...@@ -73,7 +73,7 @@ namespace FLY.Thick.Base.UI.CustomSection ...@@ -73,7 +73,7 @@ namespace FLY.Thick.Base.UI.CustomSection
public void Init(ParamDictionary paramDictionary) public void Init(ParamDictionary paramDictionary)
{ {
paramDictionary.SetBinding(this, nameof(XStep), XStep); paramDictionary.SetBinding(this, nameof(XStep), ParamDistItemKeys.XStep, XStep);
} }
} }
......
...@@ -248,6 +248,9 @@ ...@@ -248,6 +248,9 @@
<DependentUpon>PgFixAnalyze.xaml</DependentUpon> <DependentUpon>PgFixAnalyze.xaml</DependentUpon>
</Compile> </Compile>
<Compile Include="UiModule\FixGraph\UiModule2_FixGraph.cs" /> <Compile Include="UiModule\FixGraph\UiModule2_FixGraph.cs" />
<Compile Include="UiModule\MenuMotion2.xaml.cs">
<DependentUpon>MenuMotion2.xaml</DependentUpon>
</Compile>
<Compile Include="UiModule\MenuMotion.xaml.cs"> <Compile Include="UiModule\MenuMotion.xaml.cs">
<DependentUpon>MenuMotion.xaml</DependentUpon> <DependentUpon>MenuMotion.xaml</DependentUpon>
</Compile> </Compile>
...@@ -400,6 +403,10 @@ ...@@ -400,6 +403,10 @@
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
</Page> </Page>
<Page Include="Themes\GraphStyle.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="Themes\String.xaml"> <Page Include="Themes\String.xaml">
<SubType>Designer</SubType> <SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
...@@ -440,6 +447,10 @@ ...@@ -440,6 +447,10 @@
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
</Page> </Page>
<Page Include="UiModule\MenuMotion2.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Page Include="UiModule\MenuMotion.xaml"> <Page Include="UiModule\MenuMotion.xaml">
<Generator>MSBuild:Compile</Generator> <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType> <SubType>Designer</SubType>
......
...@@ -18,5 +18,6 @@ namespace FLY.Thick.Base.UI ...@@ -18,5 +18,6 @@ namespace FLY.Thick.Base.UI
public const string LCUS1_Enable = "LCUS1_Enable"; public const string LCUS1_Enable = "LCUS1_Enable";
public const string WindowSize = "WindowSize"; public const string WindowSize = "WindowSize";
public const string SkipWarningUnityNames = "SkipWarningUnityNames"; public const string SkipWarningUnityNames = "SkipWarningUnityNames";
public const string XStep = "XStep";
} }
} }
...@@ -29,13 +29,10 @@ ...@@ -29,13 +29,10 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}"> <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="授权码" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="授权码" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Access, Converter={StaticResource bytesconv}}" Tag="Full"/> <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Access, Converter={StaticResource bytesconv}}" Tag="Full"/>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<Button Style="{StaticResource Styles.Button.Apply}" Command="{Binding ApplyCmd}" />
<Button Style="{StaticResource ButtonStyle2}" Content="应用" Margin="{StaticResource ControlMargin}" Width="auto" Command="{Binding ApplyCmd}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
......
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:lvc="clr-namespace:LiveCharts.Wpf;assembly=LiveCharts.Wpf">
<!--颜色-->
<SolidColorBrush x:Key="TextBrush" Color="#4C4949" />
<SolidColorBrush x:Key="GrayBrush1" Color="#FF727272"/>
<SolidColorBrush x:Key="GrayBrush2" Color="#FF858484" />
<SolidColorBrush x:Key="SemiTransparentGreyBrush2" Color="#99FFFFFF"/>
<SolidColorBrush x:Key="SemiTransparentGreyBrush" Color="#99F0F0F0"/>
<SolidColorBrush x:Key="SemiTransparentActiveBrush" Color="#50008BE5"/>
<SolidColorBrush x:Key="WhiteBrush" Color="White"/>
<!--尺寸-->
<sys:Double x:Key="FontSize.Title">16</sys:Double>
<sys:Double x:Key="FontSize.Value">20</sys:Double>
<sys:Double x:Key="FontSize.Unit">15</sys:Double>
<Thickness x:Key="TextMargin">5,0</Thickness>
<!--字体-->
<Style x:Key="TitleStyle" TargetType="TextBlock">
<Setter Property="Width" Value="50"/>
<Setter Property="Foreground" Value="{StaticResource GrayBrush1}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Title}"/>
<Setter Property="TextAlignment" Value="Right"/>
</Style>
<Style x:Key="ValueStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Value}"/>
<Setter Property="Padding" Value="{StaticResource TextMargin}"/>
</Style>
<Style x:Key="UnitStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{StaticResource GrayBrush2}"/>
<Setter Property="FontSize" Value="{StaticResource FontSize.Unit}"/>
<Setter Property="VerticalAlignment" Value="Bottom"/>
</Style>
<!--Axis.Section-->
<Style x:Key="Styles.Axis.Section.Selected" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="False"/>
<Setter Property="DisableAnimations" Value="True"/>
<Setter Property="DataLabelForeground" Value="White"/>
<Setter Property="Opacity" Value="0.1"/>
<Setter Property="Stroke" Value="#FFCA000C"/>
<Setter Property="Fill" Value="#59CA000C"/>
<!--<Setter Property="Stroke" Value="#FFFDC8C8"/>-->
<!--<Setter Property="Fill" Value="#59F7D8D8"/>-->
</Style>
<!--扫描图,纵向趋势图Y轴 标签-->
<Style x:Key="AxisSectionStyle" TargetType="lvc:AxisSection" >
<Setter Property="StrokeThickness" Value="1"/>
<Setter Property="DataLabel" Value="True"/>
<Setter Property="DisableAnimations" Value="True"/>
<Setter Property="DataLabelForeground" Value="White"/>
<Setter Property="Opacity" Value="0.5"/>
<Setter Property="Panel.ZIndex" Value="1"/>
</Style>
</ResourceDictionary>
\ No newline at end of file
...@@ -25,14 +25,14 @@ ...@@ -25,14 +25,14 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}"> <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="混合数" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="混合数" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding Mix}" /> <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding Mix}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}"> <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="间隔" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="间隔" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<ComboBox x:Name="combox_intervalopt" Width="140" HorizontalAlignment="Left" FontSize="32" <ComboBox x:Name="combox_intervalopt" Width="140" HorizontalAlignment="Left" FontSize="{StaticResource FontSize.FieldContent}"
ItemsSource="{Binding DataContext.IntervalOpt, ElementName=grid_null}" ItemsSource="{Binding DataContext.IntervalOpt, ElementName=grid_null}"
DisplayMemberPath="Title" SelectedValuePath="Interval" DisplayMemberPath="Title" SelectedValuePath="Interval"
SelectedValue="{Binding Interval}"/> SelectedValue="{Binding Interval}"/>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}"> <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="数据量" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="数据量" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<ComboBox x:Name="combox_datalenopt" Width="140" HorizontalAlignment="Left" FontSize="32" <ComboBox x:Name="combox_datalenopt" Width="140" HorizontalAlignment="Left" FontSize="{StaticResource FontSize.FieldContent}"
ItemsSource="{Binding DataContext.DataLenOpt, ElementName=grid_null}" ItemsSource="{Binding DataContext.DataLenOpt, ElementName=grid_null}"
SelectedValue="{Binding Len}"/> SelectedValue="{Binding Len}"/>
<TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" /> <TextBlock Style="{StaticResource Styles.Text.FieldContent.Separator}" />
...@@ -75,19 +75,17 @@ ...@@ -75,19 +75,17 @@
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}" Visibility="{Binding IsAutoTarget,Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}"> <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}" Visibility="{Binding IsAutoTarget,Converter={StaticResource visbilityconv}, ConverterParameter=HiddenWhenTrue}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="Y轴中值" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="Y轴中值" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding YTarget}" /> <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding YTarget}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}"> <StackPanel Orientation="Vertical" Margin="{StaticResource ControlMargin}">
<TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="Y轴范围" /> <TextBlock Style="{StaticResource Styles.Text.FieldHeader.Editable}" Text="Y轴范围" />
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox Style="{StaticResource Styles.Text.FieldContent.Input}" Text="{Binding YRange}" /> <TextBox Style="{StaticResource Styles.Text.FieldContent.Input.Card}" Text="{Binding YRange}" />
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
<Button Style="{StaticResource Styles.Button.Empty}" HorizontalAlignment="Right" VerticalAlignment="Bottom" Click="button_save_Click" Margin="5,-100,5,0" Background="White"> <Button Style="{StaticResource Styles.Button.Apply}" Click="button_save_Click" />
<Path Data="{StaticResource Geometry_check-circle}" Fill="{StaticResource Color_theme_activity}" Stretch="Fill" Height="80" Width="80" />
</Button>
</StackPanel> </StackPanel>
</Grid> </Grid>
......
...@@ -34,8 +34,7 @@ ...@@ -34,8 +34,7 @@
<lvc:LineSeries <lvc:LineSeries
Values="{Binding Values}" Values="{Binding Values}"
StrokeThickness = "3" StrokeThickness = "3"
Stroke = "{StaticResource Brushes.Static}"
Stroke = "{StaticResource Color_theme_static}"
Fill = "Transparent" Fill = "Transparent"
PointGeometry ="{x:Null}" PointGeometry ="{x:Null}"
/> />
...@@ -51,7 +50,7 @@ ...@@ -51,7 +50,7 @@
<lvc:AxisSection Value="{Binding XPointer}" <lvc:AxisSection Value="{Binding XPointer}"
DataLabel="True" DataLabel="True"
StrokeThickness="1" StrokeThickness="1"
Stroke="#ff5722" Stroke="Orange"
DisableAnimations="True" DisableAnimations="True"
DataLabelForeground="White" DataLabelForeground="White"
Panel.ZIndex="1"/> Panel.ZIndex="1"/>
...@@ -91,23 +90,15 @@ ...@@ -91,23 +90,15 @@
</Grid> </Grid>
</Grid> </Grid>
<Grid Background="{StaticResource Brushes.TitleBar.Background}" >
<Grid Background="{StaticResource Brush_theme_bar}" Height="80">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="auto"/>
<ColumnDefinition/> <ColumnDefinition/>
<ColumnDefinition Width="auto"/> <ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Button Style="{StaticResource Styles.Button.Empty}" Command="BrowseBack" Margin="10"> <StackPanel Orientation="Horizontal" >
<Grid> <Button Style="{StaticResource Styles.TitleBar.BackButton2}" Command="BrowseBack"/>
<Rectangle Width="60" Height="60" Fill="White"/> <TextBlock Style="{StaticResource Styles.TitleBar.Text}" Text="FFT分析"/>
<Path Fill="{StaticResource Brush_theme_bar}" Data="{StaticResource Geometry_arrow-left-bold}" </StackPanel>
SnapsToDevicePixels ="True"
Stretch="Fill"
Height="30" Width="30" />
</Grid>
</Button>
<TextBlock Grid.Column="1" FontWeight="Bold" FontFamily="Arial" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" FontSize="35" Text="FFT分析"/>
</Grid> </Grid>
</Grid> </Grid>
</Page> </Page>
...@@ -179,7 +179,7 @@ namespace FLY.Thick.Base.UI.UiModule ...@@ -179,7 +179,7 @@ namespace FLY.Thick.Base.UI.UiModule
XFormatter = (d) => XFormatter = (d) =>
{ {
int n = (int)d; int n = (int)d;
return ((n) * MinFs).ToString("F1"); return ((n) * MinFs).ToString("F2");
}; };
Values.Clear(); Values.Clear();
// //
......
...@@ -5,50 +5,103 @@ ...@@ -5,50 +5,103 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:FLY.Thick.Base.UI.UiModule" xmlns:local="clr-namespace:FLY.Thick.Base.UI.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks" xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
xmlns:common="clr-namespace:FLY.Thick.Base.Common;assembly=FLY.Thick.Base"
mc:Ignorable="d" > mc:Ignorable="d" >
<UserControl.Resources> <UserControl.Resources>
<ResourceDictionary> <ResourceDictionary>
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/> <ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="ActivatedBrush" Color="#FF23d96e" />
<SolidColorBrush x:Key="ActivatedBrush2" Color="Red" />
<SolidColorBrush x:Key="NoActivatedBrush" Color="White" />
<SolidColorBrush x:Key="TextBrush" Color="White" />
</ResourceDictionary> </ResourceDictionary>
</UserControl.Resources> </UserControl.Resources>
<StackPanel> <StackPanel>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White" <Button Click="btnScanClick">
Click="btnScanClick"> <Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.SCAN}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel > <StackPanel >
<iconPacks:PackIconMaterial Kind="Rotate3dVariant" /> <iconPacks:PackIconMaterial Kind="Rotate3dVariant" />
<!--<iconPacks:PackIconMaterial Kind="TapeMeasure" />--> <!--<iconPacks:PackIconMaterial Kind="TapeMeasure" />-->
<!--<iconPacks:PackIconMaterial Kind="TransitTransfer" />--> <!--<iconPacks:PackIconMaterial Kind="TransitTransfer" />-->
<TextBlock Text="扫描" Foreground="White"/> <TextBlock Text="扫描" Foreground="{StaticResource TextBrush}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="Red" <Button Click="btnStopClick">
Click="btnStopClick"> <Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.FIX}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush2}"/>
</DataTrigger>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.STOP}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush2}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel > <StackPanel >
<iconPacks:PackIconMaterial Kind="CloseCircle" /> <iconPacks:PackIconMaterial Kind="CloseCircle" />
<TextBlock Text="停止" Foreground="Red"/> <TextBlock Text="停止" Foreground="{StaticResource TextBrush}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White" <Button Click="btnOrgClick">
Click="btnOrgClick"> <Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.ORG}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel > <StackPanel >
<iconPacks:PackIconMaterial Kind="Adjust" /> <iconPacks:PackIconMaterial Kind="Adjust" />
<TextBlock Text="归零" Foreground="White"/> <TextBlock Text="归零" Foreground="{StaticResource TextBrush}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White" <Button Click="btnForwClick">
Click="btnForwClick"> <Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.FORW}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel > <StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowRightBoldCircle" /> <iconPacks:PackIconMaterial Kind="ArrowRightBoldCircle" />
<TextBlock Text="正行" Foreground="White"/> <TextBlock Text="正行" Foreground="{StaticResource TextBrush}"/>
</StackPanel> </StackPanel>
</Button> </Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White" <Button Click="btnBackwClick">
Click="btnBackwClick"> <Button.Style>
<Style TargetType="Button" BasedOn="{StaticResource Styles.Button.Icon}">
<Setter Property="Foreground" Value="{StaticResource NoActivatedBrush}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding DynArea.ControllerState}" Value="{x:Static common:CTRL_STATE.BACKW}">
<Setter Property="Foreground" Value="{StaticResource ActivatedBrush}"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Button.Style>
<StackPanel > <StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowLeftBoldCircle" /> <iconPacks:PackIconMaterial Kind="ArrowLeftBoldCircle" />
<TextBlock Text="反行" Foreground="White"/> <TextBlock Text="反行" Foreground="{StaticResource TextBrush}"/>
</StackPanel> </StackPanel>
</Button> </Button>
</StackPanel> </StackPanel>
......
...@@ -11,46 +11,48 @@ namespace FLY.Thick.Base.UI.UiModule ...@@ -11,46 +11,48 @@ namespace FLY.Thick.Base.UI.UiModule
/// </summary> /// </summary>
public partial class MenuMotion : UserControl public partial class MenuMotion : UserControl
{ {
ITDGageService tDGageService; ITDGageService gageService;
public MenuMotion() public MenuMotion()
{ {
InitializeComponent(); InitializeComponent();
} }
[InjectionMethod] [InjectionMethod]
public void Init(ITDGageService tDGageService) public void Init(ITDGageService gageService)
{ {
this.tDGageService = tDGageService; this.gageService = gageService;
this.DataContext = gageService;
//gageService.DynArea.ControllerState
} }
private void btnBackwClick(object sender, RoutedEventArgs e) private void btnBackwClick(object sender, RoutedEventArgs e)
{ {
tDGageService.StartP2(Base.Common.STARTP2_MODE.BACKW); gageService.StartP2(Base.Common.STARTP2_MODE.BACKW);
} }
private void btnForwClick(object sender, RoutedEventArgs e) private void btnForwClick(object sender, RoutedEventArgs e)
{ {
tDGageService.StartP2(Base.Common.STARTP2_MODE.FORW); gageService.StartP2(Base.Common.STARTP2_MODE.FORW);
} }
private void btnOrgClick(object sender, RoutedEventArgs e) private void btnOrgClick(object sender, RoutedEventArgs e)
{ {
tDGageService.StartP2(Base.Common.STARTP2_MODE.ORG); gageService.StartP2(Base.Common.STARTP2_MODE.ORG);
} }
private void btnStopClick(object sender, RoutedEventArgs e) private void btnStopClick(object sender, RoutedEventArgs e)
{ {
tDGageService.StartP2(Base.Common.STARTP2_MODE.STOP); gageService.StartP2(Base.Common.STARTP2_MODE.STOP);
} }
private void btnScanClick(object sender, RoutedEventArgs e) private void btnScanClick(object sender, RoutedEventArgs e)
{ {
tDGageService.StartP1(); gageService.StartP1();
} }
} }
public class UiModule2_MenuMotion : IUiModule2 public class UiModule2_MenuMotion : IUiModule2
{ {
public string Title => "扫描运行"; public string Title => "测厚.扫描运行";
public ComponentType Type => ComponentType.Menu; public ComponentType Type => ComponentType.Menu;
......
<UserControl x:Class="FLY.Thick.Base.UI.UiModule.MenuMotion2"
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:FLY.Thick.Base.UI.UiModule"
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
mc:Ignorable="d" >
<UserControl.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/FLY.Thick.Base.UI;component/Themes/Styles.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</UserControl.Resources>
<StackPanel>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnScanClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="Rotate3dVariant" />
<!--<iconPacks:PackIconMaterial Kind="TapeMeasure" />-->
<!--<iconPacks:PackIconMaterial Kind="TransitTransfer" />-->
<TextBlock Text="扫描" Foreground="White"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="Red"
Click="btnStopClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="CloseCircle" />
<TextBlock Text="停止" Foreground="Red"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnOrgClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="Adjust" />
<TextBlock Text="归零" Foreground="White"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnForwClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowRightBoldCircle" />
<TextBlock Text="正行" Foreground="White"/>
</StackPanel>
</Button>
<Button Style="{StaticResource Styles.Button.Icon}" Foreground="White"
Click="btnBackwClick">
<StackPanel >
<iconPacks:PackIconMaterial Kind="ArrowLeftBoldCircle" />
<TextBlock Text="反行" Foreground="White"/>
</StackPanel>
</Button>
</StackPanel>
</UserControl>
using FLY.Thick.Base.IService;
using MultiLayout.UiModule;
using System.Windows;
using System.Windows.Controls;
using Unity;
namespace FLY.Thick.Base.UI.UiModule
{
/// <summary>
/// MenuMotion.xaml 的交互逻辑
/// </summary>
public partial class MenuMotion2 : UserControl
{
ITDGageService tDGageService;
public MenuMotion2()
{
InitializeComponent();
}
[InjectionMethod]
public void Init(ITDGageService tDGageService)
{
this.tDGageService = tDGageService;
}
private void btnBackwClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.BACKW);
}
private void btnForwClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.FORW);
}
private void btnOrgClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.ORG);
}
private void btnStopClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP2(Base.Common.STARTP2_MODE.STOP);
}
private void btnScanClick(object sender, RoutedEventArgs e)
{
tDGageService.StartP1();
}
}
public class UiModule2_MenuMotion2 : IUiModule2
{
public string Title => "测厚.扫描运行2";
public ComponentType Type => ComponentType.Menu;
public bool IsUnique => true;
public FrameworkElement GetComponent(int id, IUnityContainer container)
{
MenuMotion2 menu = new MenuMotion2();
container.BuildUp(menu);
return menu;
}
public FrameworkElement GetThumbnail()
{
return new System.Windows.Controls.Grid();
}
public void MatchParam(int[] IDs)
{
}
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment