|
@@ -1,2 +1,670 @@
|
|
|
-### SKMC.UI
|
|
|
|
|
-## 通用UI库
|
|
|
|
|
|
|
+# 基础UI库(SKMC.UI)
|
|
|
|
|
+
|
|
|
|
|
+统一资源,统一样式,统一字体,控件自定义。
|
|
|
|
|
+
|
|
|
|
|
+## 基础说明
|
|
|
|
|
+主要分类:Assets资源文件、Converters基础转换器、CustomControls自定义控件、Styles控件样式、Themes主题、ValidationRules校验规则资源。
|
|
|
|
|
+### Colors.xaml
|
|
|
|
|
+颜色资源文件,使用16进制颜色标签,作为后续画刷基础颜色,项目中可根据需求更改
|
|
|
|
|
+```
|
|
|
|
|
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
+ <!--基础颜色/公共颜色-->
|
|
|
|
|
+ <Color x:Key="Color.Neutral">#545454</Color>
|
|
|
|
|
+ <Color x:Key="Color.Error">#FF191C</Color>
|
|
|
|
|
+ <Color x:Key="Color.Warning">#FCB000</Color>
|
|
|
|
|
+ <Color x:Key="Color.Good">#00F976</Color>
|
|
|
|
|
+ <Color x:Key="Color.RgbGreen">#00FF00</Color>
|
|
|
|
|
+ <Color x:Key="Color.DebugLog">#5ADAE2</Color>
|
|
|
|
|
+ <Color x:Key="Color.Blue">#0000FF</Color>
|
|
|
|
|
+ <Color x:Key="Color.DrawCross">Green</Color>
|
|
|
|
|
+ <Color x:Key="Color.Ruler">Red</Color>
|
|
|
|
|
+ <Color x:Key="Color.ZoomWindow">Yellow</Color>
|
|
|
|
|
+ <Color x:Key="Color.Start">#009647</Color>
|
|
|
|
|
+ <Color x:Key="Color.Stop">#CD1315</Color>
|
|
|
|
|
+ <Color x:Key="Color.Pause">#FCB000</Color>
|
|
|
|
|
+ <Color x:Key="Color.HomePosition">#0091FF</Color>
|
|
|
|
|
+ <Color x:Key="Color.LockDoors">#FCB000</Color>
|
|
|
|
|
+ <Color x:Key="Color.RgbBlue">#363BFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Element">Green</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.SecondaryElement">LightGreen</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.SelectedElement">Blue</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.NotValid">Red</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Origin">Cyan</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.ScanFieldOutline">LightBlue</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.SelectedContour">LightBlue</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.MaterialOutline">Gray</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.LaneOutline">Olive</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Scanfield">White</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.OriginMarker">Green</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Padding">Orange</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.HardwareLimitOutline">LightGray</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Grid">#50A0A0A0</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Layer0">Black</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Layer1">Green</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Layer2">Orange</Color>
|
|
|
|
|
+ <Color x:Key="Color.ViewPort.Layer3">Fuchsia</Color>
|
|
|
|
|
+</ResourceDictionary>
|
|
|
|
|
+```
|
|
|
|
|
+### Brushes.xaml
|
|
|
|
|
+通用基础画刷,该资源作为全局通用画刷,不随主题切换变更,在XAML使用时需要注意目标控件是否需要跟随主题切换变更。SolidColorBrush固定画刷引用Colors.xaml资源内设定的Color
|
|
|
|
|
+```
|
|
|
|
|
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
+ <!--公共画刷,不随主题切换-->
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.MachineControls" Color="{DynamicResource Color.MachineControls}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay2Percent" Opacity="0.02" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay3Percent" Opacity="0.03" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay5Percent" Opacity="0.05" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay6Percent" Opacity="0.06" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay7Percent" Opacity="0.07" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay8Percent" Opacity="0.08" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay12Percent" Opacity="0.12" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay17Percent" Opacity="0.17" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay24Percent" Opacity="0.24" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Overlay48Percent" Opacity="0.5" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DarkOverlay12Percent" Opacity="0.12" Color="{DynamicResource Color.DarkOverlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DarkOverlay80Percent" Opacity="0.8" Color="{DynamicResource Color.DarkOverlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DarkOverlay50Percent" Opacity="0.5" Color="{DynamicResource Color.DarkOverlay}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SecondaryButton" Opacity="0.12" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SecondaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SecondaryButtonPressed" Opacity="0.08" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SecondaryButtonDisabled" Opacity="0.03" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TertiaryButton" Color="Transparent" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TertiaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TertiaryButtonPressed" Opacity="0.08" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TertiaryButtonDisabled" Color="Transparent" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TertiaryButtonBorder" Opacity="0.48" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TertiaryButtonPressedBorder" Opacity="0.16" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TertiaryButtonDisabledBorder" Opacity="0.03" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SelectedBorder" Color="{DynamicResource Color.SelectedBorder}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.NotSelectedBorder" Color="{DynamicResource Color.Border}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SelectionDisabledBackground" Color="{DynamicResource Color.SelectionDisabledBackground}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SelectionInactiveBorder" Opacity="0.38" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SelectionSelected" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SelectionSelectedBackground" Opacity="0.5" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Label" Color="{DynamicResource Color.Label}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SecondaryFont" Opacity="0.6" Color="{DynamicResource Color.Text}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Annotation" Color="DarkViolet" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TextSecondColor" Color="Yellow" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DebugText" Color="White" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DebugTextOver" Opacity="0.5" Color="White" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.RgbRed" Color="{DynamicResource Color.Error}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.RgbGreen" Color="{DynamicResource Color.RgbGreen}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.RgbBlue" Color="{DynamicResource Color.RgbBlue}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Neutral" Color="{DynamicResource Color.Neutral}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Error" Color="{DynamicResource Color.Error}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ErrorLowOpacity" Opacity="0.1" Color="{DynamicResource Color.Error}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Warning" Color="{DynamicResource Color.Warning}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.WarningLowOpacity" Opacity="0.1" Color="{DynamicResource Color.Warning}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Good" Color="{DynamicResource Color.Good}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.GoodLowOpacity" Opacity="0.1" Color="{DynamicResource Color.Good}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DebugLog" Color="{DynamicResource Color.DebugLog}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Start" Color="{DynamicResource Color.Start}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Stop" Color="{DynamicResource Color.Stop}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Pause" Color="{DynamicResource Color.Pause}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.HomePosition" Color="{DynamicResource Color.HomePosition}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.LockDoors" Color="{DynamicResource Color.LockDoors}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Ellipse" Color="LimeGreen" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.StripeFirstEdge" Color="LimeGreen" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.StripeSecondFirstEdge" Color="LimeGreen" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.StripeMiddleLine" Color="Red" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Contour" Color="Blue" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SecondContour" Color="Orange" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.CrossMarker" Color="Blue" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.0" Color="Violet" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.1" Color="White" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.2" Color="LimeGreen" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.3" Color="Yellow" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.4" Color="Red" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.5" Color="LightBlue" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.6" Color="Orange" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.7" Color="Pink" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.8" Color="LightGray" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ChartLine.9" Color="LightYellow" />
|
|
|
|
|
+</ResourceDictionary>
|
|
|
|
|
+```
|
|
|
|
|
+### Dark.xaml
|
|
|
|
|
+深色主题资源文件对项目中部分/主要控件颜色设立动态颜色切换,比如:整体背景色、字体颜色、按钮颜色等。只区分主要颜色,其它颜色使用Brushes.xaml不跟随主题变更显示
|
|
|
|
|
+
|
|
|
|
|
+```
|
|
|
|
|
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
+ <!--深色主题-->
|
|
|
|
|
+ <Color x:Key="Color.Background">#1E1E1E</Color>
|
|
|
|
|
+ <Color x:Key="Color.DarkBackground">#161616</Color>
|
|
|
|
|
+ <Color x:Key="Color.MachineControls">#121212</Color>
|
|
|
|
|
+ <Color x:Key="Color.Overlay">#FCF3EC</Color>
|
|
|
|
|
+ <Color x:Key="Color.DarkOverlay">#000000</Color>
|
|
|
|
|
+ <Color x:Key="Color.HeaderAlternative">#2D2D2D</Color>
|
|
|
|
|
+ <Color x:Key="Color.BodyAlternative">#3C3C3C</Color>
|
|
|
|
|
+ <Color x:Key="Color.Button">#FFFFFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.Text">#FFFFFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.TextContrast">#292929</Color>
|
|
|
|
|
+ <Color x:Key="Color.TextInactive">#9C9C9C</Color>
|
|
|
|
|
+ <Color x:Key="Color.PreviewBackground">#444</Color>
|
|
|
|
|
+ <Color x:Key="Color.Label">#848484</Color>
|
|
|
|
|
+ <Color x:Key="Color.Icon">#FFFFFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.IconInactive">#9C9C9C</Color>
|
|
|
|
|
+ <Color x:Key="Color.Border">#808080</Color>
|
|
|
|
|
+ <Color x:Key="Color.DashboardBackground">#3a3a3a</Color>
|
|
|
|
|
+ <Color x:Key="Color.SelectedBorder">#FFFFFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.SelectionDisabledBackground">#333333</Color>
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Background" Color="{DynamicResource Color.Background}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DarkBackground" Color="{DynamicResource Color.DarkBackground}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PreviewBackground" Color="{DynamicResource Color.PreviewBackground}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Button" Color="{DynamicResource Color.Button}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonPressed" Opacity="0.08" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonTextInactive" Opacity="0.38" Color="{DynamicResource Color.Text}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonTextDisabled" Opacity="0.30" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonHover" Opacity="0.2" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButton" Opacity="0.5" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButtonPressed" Color="{DynamicResource Color.SignatureDark}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButtonDisabled" Opacity="0.5" Color="{DynamicResource Color.SignatureDark}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Text" Color="{DynamicResource Color.Text}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TextContrast" Color="{DynamicResource Color.TextContrast}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TextInactive" Color="{DynamicResource Color.TextInactive}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Icon" Color="{DynamicResource Color.Icon}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.IconInactive" Color="{DynamicResource Color.IconInactive}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Border" Color="{DynamicResource Color.Border}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DashboardBackground" Color="{DynamicResource Color.DashboardBackground}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.HeaderAlternative" Color="{DynamicResource Color.HeaderAlternative}"/>
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.BodyAlternative" Color="{DynamicResource Color.BodyAlternative}"/>
|
|
|
|
|
+
|
|
|
|
|
+ <Color x:Key="Color.Signature">#00AFAF</Color>
|
|
|
|
|
+ <Color x:Key="Color.SignatureLight">#CCEAEC</Color>
|
|
|
|
|
+ <Color x:Key="Color.SignatureDark">#006D75</Color>
|
|
|
|
|
+ <Color x:Key="Color.SignatureAccent">#00929D</Color>
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Signature" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SignatureLight" Color="{DynamicResource Color.SignatureLight}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SignatureDark" Color="{DynamicResource Color.SignatureDark}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SignatureAccent" Color="{DynamicResource Color.SignatureAccent}" />
|
|
|
|
|
+
|
|
|
|
|
+</ResourceDictionary>
|
|
|
|
|
+```
|
|
|
|
|
+### Light.xaml
|
|
|
|
|
+浅色主题同上,深色主题与浅色主题切换时,需要保证两者画刷资源key相同且数量相同,切换主题本质上切换**Dark.xaml**和**Light.xaml**资源,若同一个画刷只存在其中一个主题文件中,在切换是会找不到对应**key**资源。
|
|
|
|
|
+```
|
|
|
|
|
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
+ <!-- 浅色主题 -->
|
|
|
|
|
+ <Color x:Key="Color.Background">#FFFFFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.DarkBackground">#E8F1FA</Color>
|
|
|
|
|
+ <Color x:Key="Color.MachineControls">#DCDCDC</Color>
|
|
|
|
|
+ <Color x:Key="Color.Overlay">#FCF3EC</Color>
|
|
|
|
|
+ <Color x:Key="Color.DarkOverlay">#FFFFFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.HeaderAlternative">#FCE4D2</Color>
|
|
|
|
|
+ <Color x:Key="Color.BodyAlternative">#FFFBF0</Color>
|
|
|
|
|
+ <Color x:Key="Color.Button">#333333</Color>
|
|
|
|
|
+ <Color x:Key="Color.Text">#1A1A1A</Color>
|
|
|
|
|
+ <Color x:Key="Color.TextContrast">#F5F5F5</Color>
|
|
|
|
|
+ <Color x:Key="Color.TextInactive">#666666</Color>
|
|
|
|
|
+ <Color x:Key="Color.PreviewBackground">#FFFFFF</Color>
|
|
|
|
|
+ <Color x:Key="Color.Label">#7A7A7A</Color>
|
|
|
|
|
+ <Color x:Key="Color.Icon">#1A1A1A</Color>
|
|
|
|
|
+ <Color x:Key="Color.IconInactive">#666666</Color>
|
|
|
|
|
+ <Color x:Key="Color.Border">#A0A0A0</Color>
|
|
|
|
|
+ <Color x:Key="Color.DashboardBackground">#C8C8C8</Color>
|
|
|
|
|
+ <Color x:Key="Color.SelectedBorder">#1A1A1A</Color>
|
|
|
|
|
+ <Color x:Key="Color.SelectionDisabledBackground">#CCCCCC</Color>
|
|
|
|
|
+
|
|
|
|
|
+ <Color x:Key="Color.Signature">#00929D</Color>
|
|
|
|
|
+ <Color x:Key="Color.SignatureLight">#CCEAEC</Color>
|
|
|
|
|
+ <Color x:Key="Color.SignatureDark">#006D75</Color>
|
|
|
|
|
+ <Color x:Key="Color.SignatureAccent">#00929D</Color>
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Background" Color="{DynamicResource Color.Background}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DarkBackground" Color="{DynamicResource Color.DarkBackground}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PreviewBackground" Color="{DynamicResource Color.PreviewBackground}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Button" Color="{DynamicResource Color.Button}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonPressed" Opacity="0.08" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonTextInactive" Opacity="0.38" Color="{DynamicResource Color.Text}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonTextDisabled" Opacity="0.30" Color="{DynamicResource Color.Overlay}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.ButtonHover" Opacity="0.2" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButton" Opacity="0.5" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButtonMouseOver" Opacity="0.24" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButtonPressed" Color="{DynamicResource Color.SignatureDark}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.PrimaryButtonDisabled" Opacity="0.5" Color="{DynamicResource Color.SignatureDark}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Text" Color="{DynamicResource Color.Text}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TextContrast" Color="{DynamicResource Color.TextContrast}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.TextInactive" Color="{DynamicResource Color.TextInactive}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Icon" Color="{DynamicResource Color.Icon}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.IconInactive" Color="{DynamicResource Color.IconInactive}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Border" Color="{DynamicResource Color.Border}" />
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.DashboardBackground" Color="{DynamicResource Color.DashboardBackground}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.HeaderAlternative" Opacity="0.5" Color="{DynamicResource Color.HeaderAlternative}"/>
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.BodyAlternative" Color="{DynamicResource Color.BodyAlternative}"/>
|
|
|
|
|
+
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.Signature" Color="{DynamicResource Color.Signature}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SignatureLight" Color="{DynamicResource Color.SignatureLight}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SignatureDark" Color="{DynamicResource Color.SignatureDark}" />
|
|
|
|
|
+ <SolidColorBrush x:Key="Brush.SignatureAccent" Color="{DynamicResource Color.SignatureAccent}" />
|
|
|
|
|
+</ResourceDictionary>
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+## 使用方法
|
|
|
|
|
+Styles/
|
|
|
|
|
+|—— Border.xaml # Border 样式
|
|
|
|
|
+|—— Button.xaml # Button 样式
|
|
|
|
|
+|—— Calendar.xaml # Calendar 样式
|
|
|
|
|
+|—— ComboBox.xaml # ComboBox 样式
|
|
|
|
|
+|—— DataGrid.xaml # DataGrid 样式
|
|
|
|
|
+|—— DatePicker.xaml # DatePicker 样式
|
|
|
|
|
+|—— ListView.xaml # ListView 样式
|
|
|
|
|
+|—— RadioButton.xaml # RadioButton 样式
|
|
|
|
|
+|—— ScrollViewer.xaml # ScrollViewer 样式
|
|
|
|
|
+|—— TapItem.xaml # TapItem 样式
|
|
|
|
|
+|—— TextBlock.xaml # TextBlock 样式
|
|
|
|
|
+|—— TextBox.xaml # TextBox 样式
|
|
|
|
|
+└── ToggleButton.xaml # ToggleButton 样式
|
|
|
|
|
+### 在XAML中使用
|
|
|
|
|
+#### Border
|
|
|
|
|
+- Border.Base
|
|
|
|
|
+```
|
|
|
|
|
+<Border Style="{StaticResource Border.Base}">
|
|
|
|
|
+ <Grid>
|
|
|
|
|
+ <Grid.RowDefinitions>
|
|
|
|
|
+ <RowDefinition Height="30" />
|
|
|
|
|
+ <RowDefinition />
|
|
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
|
+ <Border Background="#0078D7">
|
|
|
|
|
+ <TextBlock Text="运动测试"
|
|
|
|
|
+ Style="{StaticResource TextBlock.Primary}"
|
|
|
|
|
+ HorizontalAlignment="Left"
|
|
|
|
|
+ FontWeight="Normal"
|
|
|
|
|
+ Margin="10 0 0 0"/>
|
|
|
|
|
+ </Border>
|
|
|
|
|
+ <WrapPanel Grid.Row="1">
|
|
|
|
|
+ <Button Command="{Binding MoveAxisOnePointCommand}" Style="{StaticResource Button.Debug}"
|
|
|
|
|
+ Content="MoveAxisPoint"/>
|
|
|
|
|
+ <Button Command="{Binding MoveAxisTwoPointCommand}" Style="{StaticResource Button.Debug}"
|
|
|
|
|
+ Content="MoveAxisPoint(2)"/>
|
|
|
|
|
+ <Button Command="{Binding MoveAxisOnePointFixsetCommand}" Style="{StaticResource Button.Debug}"
|
|
|
|
|
+ Content="MoveAxisPointFixset"/>
|
|
|
|
|
+ <Button Command="{Binding MoveAxisTwoPointFixsetCommand}" Style="{StaticResource Button.Debug}"
|
|
|
|
|
+ Content="MoveAxisPointFixset(2)"/>
|
|
|
|
|
+ </WrapPanel>
|
|
|
|
|
+ </Grid>
|
|
|
|
|
+</Border>
|
|
|
|
|
+```
|
|
|
|
|
+#### Button
|
|
|
|
|
+- Button.Base
|
|
|
|
|
+```
|
|
|
|
|
+<Button Width="100"
|
|
|
|
|
+ Height="36"
|
|
|
|
|
+ Command="{Binding CancelCommand}"
|
|
|
|
|
+ Content="取消"
|
|
|
|
|
+ FontSize="20"
|
|
|
|
|
+ Style="{StaticResource Button.Base}" />
|
|
|
|
|
+```
|
|
|
|
|
+- Button.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<Button Content="显示设置"
|
|
|
|
|
+ Style="{StaticResource Button.Primary}"
|
|
|
|
|
+ Width="120"
|
|
|
|
|
+ Height="30"/>
|
|
|
|
|
+```
|
|
|
|
|
+- Button.Secondary
|
|
|
|
|
+```
|
|
|
|
|
+<Button Content="显示设置"
|
|
|
|
|
+ Style="{StaticResource Button.Secondary}"
|
|
|
|
|
+ Width="120"
|
|
|
|
|
+ Height="30"/>
|
|
|
|
|
+```
|
|
|
|
|
+- Button.WithIcon
|
|
|
|
|
+```
|
|
|
|
|
+xmlns:c="clr-namespace:SKMC.UI.CustomControls;assembly=SKMC.UI"
|
|
|
|
|
+
|
|
|
|
|
+<c:SKButton
|
|
|
|
|
+ Width="125"
|
|
|
|
|
+ Height="40"
|
|
|
|
|
+ Margin="5"
|
|
|
|
|
+ Command="{Binding RetryAllCommand}"
|
|
|
|
|
+ Content="自动重试"
|
|
|
|
|
+ Style="{StaticResource Button.WithIcon}"
|
|
|
|
|
+ Icon="{StaticResource Icon.Restart}"
|
|
|
|
|
+ Background="{StaticResource Brush.DebugLog}"
|
|
|
|
|
+ IconSize="{StaticResource FontSize.Callout}"/>
|
|
|
|
|
+```
|
|
|
|
|
+- Button.Debug
|
|
|
|
|
+```
|
|
|
|
|
+<Button Command="{Binding ExceptionTestCommand}" Style="{StaticResource Button.Debug}"
|
|
|
|
|
+ Content="异常弹窗测试"/>
|
|
|
|
|
+```
|
|
|
|
|
+- Button.WindowControl
|
|
|
|
|
+- Button.SimpleIcon
|
|
|
|
|
+```
|
|
|
|
|
+<Button
|
|
|
|
|
+ Command="{Binding DataContext.GetEncCommand, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
|
|
|
|
+ CommandParameter="{Binding}"
|
|
|
|
|
+ Content="{StaticResource Icon.ChevronDoubleLeft}"
|
|
|
|
|
+ Style="{StaticResource Button.SimpleIcon}"
|
|
|
|
|
+ Margin="0"/>
|
|
|
|
|
+```
|
|
|
|
|
+#### ComboBox
|
|
|
|
|
+- ComboBox.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<ComboBox
|
|
|
|
|
+ x:Name="Rolebox"
|
|
|
|
|
+ Width="230"
|
|
|
|
|
+ Margin="20,0,10,0"
|
|
|
|
|
+ DisplayMemberPath="ShowName"
|
|
|
|
|
+ FontSize="{StaticResource FontSize.Callout}"
|
|
|
|
|
+ IsSynchronizedWithCurrentItem="True"
|
|
|
|
|
+ ItemsSource="{Binding ClientRoleAccesser.ClientRoles}"
|
|
|
|
|
+ SelectedItem="{Binding ClientRole}"
|
|
|
|
|
+ Style="{StaticResource ComboBox.Primary}"/>
|
|
|
|
|
+```
|
|
|
|
|
+#### DataGrid
|
|
|
|
|
+- DataGrid.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<DataGrid
|
|
|
|
|
+ AutoGenerateColumns="False"
|
|
|
|
|
+ CanUserAddRows="False"
|
|
|
|
|
+ ItemsSource="{Binding ClientCacher.CurrentExceptions}"
|
|
|
|
|
+ Style="{StaticResource DataGrid.Primary}">
|
|
|
|
|
+ <DataGrid.Columns>
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="0.3*"
|
|
|
|
|
+ Binding="{Binding Code}"
|
|
|
|
|
+ Header="异常码"
|
|
|
|
|
+ IsReadOnly="True"/>
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="0.8*"
|
|
|
|
|
+ Binding="{Binding Name}"
|
|
|
|
|
+ Header="异常名称"
|
|
|
|
|
+ IsReadOnly="True"/>
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="0.6*"
|
|
|
|
|
+ Binding="{Binding EncounterTime}"
|
|
|
|
|
+ Header="异常时间"
|
|
|
|
|
+ IsReadOnly="True"/>
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="0.3*"
|
|
|
|
|
+ Binding="{Binding Level}"
|
|
|
|
|
+ Header="异常级别"
|
|
|
|
|
+ IsReadOnly="True"/>
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="*"
|
|
|
|
|
+ Binding="{Binding Detail}"
|
|
|
|
|
+ Header="详细信息"
|
|
|
|
|
+ IsReadOnly="True"/>
|
|
|
|
|
+ <DataGridTemplateColumn Width="0.6*" Header="可用处理">
|
|
|
|
|
+ <DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
+ <DataTemplate>
|
|
|
|
|
+ <StackPanel HorizontalAlignment="Left" Orientation="Horizontal">
|
|
|
|
|
+ <Button
|
|
|
|
|
+ Margin="5,0"
|
|
|
|
|
+ Command="{Binding DataContext.RetryCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
|
|
|
|
+ CommandParameter="{Binding}"
|
|
|
|
|
+ Content="重试"
|
|
|
|
|
+ Visibility="{Binding CanRetry, Converter={StaticResource systemVisibilityConverter}}" />
|
|
|
|
|
+
|
|
|
|
|
+ <Button
|
|
|
|
|
+ Margin="5,0"
|
|
|
|
|
+ Command="{Binding DataContext.IgnoreCommand, RelativeSource={RelativeSource AncestorType=DataGrid}}"
|
|
|
|
|
+ CommandParameter="{Binding}"
|
|
|
|
|
+ Content="忽略"
|
|
|
|
|
+ Visibility="{Binding CanIgnore, Converter={StaticResource systemVisibilityConverter}}" />
|
|
|
|
|
+ <TextBlock Text="{Binding RetryMsg}" />
|
|
|
|
|
+ </StackPanel>
|
|
|
|
|
+ </DataTemplate>
|
|
|
|
|
+ </DataGridTemplateColumn.CellTemplate>
|
|
|
|
|
+ </DataGridTemplateColumn>
|
|
|
|
|
+ </DataGrid.Columns>
|
|
|
|
|
+</DataGrid>
|
|
|
|
|
+```
|
|
|
|
|
+- DataGrid.EditingTextBox
|
|
|
|
|
+```
|
|
|
|
|
+<DataGrid
|
|
|
|
|
+ x:Name="OriginGrid"
|
|
|
|
|
+ Grid.Column="0"
|
|
|
|
|
+ IsReadOnly="False"
|
|
|
|
|
+ ItemsSource="{Binding MachineOffsets}"
|
|
|
|
|
+ Style="{StaticResource DataGrid.Primary}"
|
|
|
|
|
+ Margin="5">
|
|
|
|
|
+ <DataGrid.Columns>
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="4*"
|
|
|
|
|
+ Binding="{Binding Code, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
+ Header="轴代码"
|
|
|
|
|
+ IsReadOnly="True" />
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="6*"
|
|
|
|
|
+ Binding="{Binding Name, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
+ Header="名称"
|
|
|
|
|
+ IsReadOnly="True" />
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="2*"
|
|
|
|
|
+ Binding="{Binding Axis_No, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
+ Header="轴号"
|
|
|
|
|
+ IsReadOnly="True" />
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="10*"
|
|
|
|
|
+ Binding="{Binding Offset, StringFormat={}{0:F3}, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
+ Header="原点偏差值(单位:mm;值的正负号与轴的正负方向一致)"
|
|
|
|
|
+ EditingElementStyle="{StaticResource DataGrid.EditingTextBox}"/>
|
|
|
|
|
+ <DataGridTextColumn
|
|
|
|
|
+ Width="10*"
|
|
|
|
|
+ Binding="{Binding Merged, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
|
+ Header="是否已合并(0代表未合并;1代表已合并)"
|
|
|
|
|
+ EditingElementStyle="{StaticResource DataGrid.EditingTextBox}"/>
|
|
|
|
|
+ </DataGrid.Columns>
|
|
|
|
|
+</DataGrid>
|
|
|
|
|
+```
|
|
|
|
|
+#### DatePicker
|
|
|
|
|
+- DatePicker.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<DatePicker
|
|
|
|
|
+ SelectedDate="{Binding SelectedDate}"
|
|
|
|
|
+ Style="{StaticResource DatePicker.Primary}">
|
|
|
|
|
+</DatePicker>
|
|
|
|
|
+```
|
|
|
|
|
+#### ListView
|
|
|
|
|
+- ListView.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<ListView
|
|
|
|
|
+ ItemsSource="{Binding Source={StaticResource ProductionLogs}}"
|
|
|
|
|
+ Style="{StaticResource ListView.Primary}">
|
|
|
|
|
+ <ListView.View>
|
|
|
|
|
+ <GridView ColumnHeaderContainerStyle="{StaticResource ListView.ColumnHeader}">
|
|
|
|
|
+ <GridViewColumn
|
|
|
|
|
+ Width="160"
|
|
|
|
|
+ DisplayMemberBinding="{Binding Timestamp}"
|
|
|
|
|
+ Header="时间"/>
|
|
|
|
|
+ <GridViewColumn
|
|
|
|
|
+ Width="60"
|
|
|
|
|
+ Header="级别">
|
|
|
|
|
+ <GridViewColumn.CellTemplate>
|
|
|
|
|
+ <DataTemplate>
|
|
|
|
|
+ <TextBlock x:Name="AlarmLevel" Text="{Binding Level}" HorizontalAlignment="Center"
|
|
|
|
|
+ VerticalAlignment="Center"/>
|
|
|
|
|
+ <DataTemplate.Triggers>
|
|
|
|
|
+ <DataTrigger Binding="{Binding Level}" Value="Debug">
|
|
|
|
|
+ <Setter TargetName="AlarmLevel" Property="Foreground" Value="{DynamicResource Brush.DebugLog}"/>
|
|
|
|
|
+ </DataTrigger>
|
|
|
|
|
+ <DataTrigger Binding="{Binding Level}" Value="Warn">
|
|
|
|
|
+ <Setter TargetName="AlarmLevel" Property="Foreground" Value="{DynamicResource Brush.Warning}"/>
|
|
|
|
|
+ </DataTrigger>
|
|
|
|
|
+ <DataTrigger Binding="{Binding Level}" Value="Error">
|
|
|
|
|
+ <Setter TargetName="AlarmLevel" Property="Foreground" Value="{DynamicResource Brush.Error}"/>
|
|
|
|
|
+ </DataTrigger>
|
|
|
|
|
+ </DataTemplate.Triggers>
|
|
|
|
|
+ </DataTemplate>
|
|
|
|
|
+ </GridViewColumn.CellTemplate>
|
|
|
|
|
+ </GridViewColumn>
|
|
|
|
|
+ <GridViewColumn
|
|
|
|
|
+ Width="50"
|
|
|
|
|
+ DisplayMemberBinding="{Binding Thread}"
|
|
|
|
|
+ Header="线程" />
|
|
|
|
|
+ <GridViewColumn
|
|
|
|
|
+ Width="730"
|
|
|
|
|
+ DisplayMemberBinding="{Binding Message}"
|
|
|
|
|
+ Header="消息" />
|
|
|
|
|
+ </GridView>
|
|
|
|
|
+ </ListView.View>
|
|
|
|
|
+</ListView>
|
|
|
|
|
+```
|
|
|
|
|
+#### RadioButton
|
|
|
|
|
+- RadioButton.SystemMenu
|
|
|
|
|
+```
|
|
|
|
|
+xmlns:c="clr-namespace:SKMC.UI.CustomControls;assembly=SKMC.UI"
|
|
|
|
|
+
|
|
|
|
|
+<c:SKRadioButton
|
|
|
|
|
+ Width="105"
|
|
|
|
|
+ Height="48"
|
|
|
|
|
+ Command="{Binding ForwardCommand}"
|
|
|
|
|
+ CommandParameter="RecordView"
|
|
|
|
|
+ IsChecked="{Binding SelectView, Converter={StaticResource radio2BoolConverter}, ConverterParameter=RecordView, Mode=TwoWay}"
|
|
|
|
|
+ Style="{StaticResource RadioButton.SystemMenu}"
|
|
|
|
|
+ Content="记录"
|
|
|
|
|
+ Icon="{StaticResource Icon.Database}">
|
|
|
|
|
+ <c:SKRadioButton.Visibility>
|
|
|
|
|
+ <MultiBinding Converter="{StaticResource appAccessVisibleConverter}">
|
|
|
|
|
+ <Binding Path="CommandParameter" RelativeSource="{RelativeSource Self}" />
|
|
|
|
|
+ <Binding Path="ClientRoleAccesser.AccessToken" />
|
|
|
|
|
+ </MultiBinding>
|
|
|
|
|
+ </c:SKRadioButton.Visibility>
|
|
|
|
|
+</c:SKRadioButton>
|
|
|
|
|
+```
|
|
|
|
|
+- RadioButton.Base
|
|
|
|
|
+- RadioButton.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<RadioButton
|
|
|
|
|
+ Width="128"
|
|
|
|
|
+ Height="40"
|
|
|
|
|
+ Command="{Binding OpenCommand}"
|
|
|
|
|
+ CommandParameter="MotionAxisView"
|
|
|
|
|
+ Content="电机"
|
|
|
|
|
+ IsChecked="True"
|
|
|
|
|
+ Style="{StaticResource RadioButton.Primary}">
|
|
|
|
|
+ <RadioButton.Visibility>
|
|
|
|
|
+ <MultiBinding Converter="{StaticResource appAccessVisibleConverter}">
|
|
|
|
|
+ <Binding Path="CommandParameter" RelativeSource="{RelativeSource Self}" />
|
|
|
|
|
+ <Binding Path="AccessToken" />
|
|
|
|
|
+ </MultiBinding>
|
|
|
|
|
+ </RadioButton.Visibility>
|
|
|
|
|
+</RadioButton>
|
|
|
|
|
+```
|
|
|
|
|
+#### ScrollViewer
|
|
|
|
|
+- ScrollViewer.Default
|
|
|
|
|
+```
|
|
|
|
|
+<ScrollViewer
|
|
|
|
|
+ Name="AxisPanel"
|
|
|
|
|
+ Grid.Row="1"
|
|
|
|
|
+ Margin="0,5,0,0"
|
|
|
|
|
+ HorizontalScrollBarVisibility="Disabled"
|
|
|
|
|
+ VerticalScrollBarVisibility="Auto"
|
|
|
|
|
+ Style="{StaticResource ScrollViewer.Default}">
|
|
|
|
|
+ <ItemsControl ItemsSource="{Binding AxisPanels}">
|
|
|
|
|
+ <ItemsControl.ItemsPanel>
|
|
|
|
|
+ <ItemsPanelTemplate>
|
|
|
|
|
+ <UniformGrid VerticalAlignment="Top" Columns="5" />
|
|
|
|
|
+ </ItemsPanelTemplate>
|
|
|
|
|
+ </ItemsControl.ItemsPanel>
|
|
|
|
|
+ <ItemsControl.ItemTemplate>
|
|
|
|
|
+ <DataTemplate>
|
|
|
|
|
+ <local:MotionAxisPanel />
|
|
|
|
|
+ </DataTemplate>
|
|
|
|
|
+ </ItemsControl.ItemTemplate>
|
|
|
|
|
+ <ItemsControl.IsEnabled>
|
|
|
|
|
+ <MultiBinding Converter="{StaticResource appAccessEnableConverter}" ConverterParameter="MotionAxisOper">
|
|
|
|
|
+ <Binding Path="MachineStatusControl.Status" />
|
|
|
|
|
+ <Binding Path="ClientRoleAccesser.AccessToken" />
|
|
|
|
|
+ </MultiBinding>
|
|
|
|
|
+ </ItemsControl.IsEnabled>
|
|
|
|
|
+ </ItemsControl>
|
|
|
|
|
+</ScrollViewer>
|
|
|
|
|
+```
|
|
|
|
|
+#### TapItem
|
|
|
|
|
+- TapItem.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<TabItem IsSelected="True"
|
|
|
|
|
+ Style="{StaticResource TapItem.Primary}"
|
|
|
|
|
+ Header="非线性校准">
|
|
|
|
|
+```
|
|
|
|
|
+#### TextBlock
|
|
|
|
|
+- TextBlock.Primary
|
|
|
|
|
+```
|
|
|
|
|
+<TextBlock
|
|
|
|
|
+ FontSize="20"
|
|
|
|
|
+ Text="原密码"
|
|
|
|
|
+ FontWeight="Normal"
|
|
|
|
|
+ Style="{StaticResource TextBlock.Primary}"/>
|
|
|
|
|
+```
|
|
|
|
|
+#### TextBox
|
|
|
|
|
+- TextBox.Primary
|
|
|
|
|
+```
|
|
|
|
|
+xmlns:c="clr-namespace:SKMC.UI.CustomControls;assembly=SKMC.UI"
|
|
|
|
|
+
|
|
|
|
|
+<c:SKTextBox
|
|
|
|
|
+ Style="{StaticResource TextBox.Primary}"
|
|
|
|
|
+ Grid.Row="0"
|
|
|
|
|
+ Grid.Column="3"
|
|
|
|
|
+ Text="{Binding VelInput, UpdateSourceTrigger=PropertyChanged, StringFormat={}{0:N3}}"
|
|
|
|
|
+ Unit="{Binding MotionAxis.UnitName}"
|
|
|
|
|
+ Grid.ColumnSpan="3"
|
|
|
|
|
+ Margin="0 1 5 0"/>
|
|
|
|
|
+```
|
|
|
|
|
+- TextBox.SimpleWatermark
|
|
|
|
|
+```
|
|
|
|
|
+<TextBox x:Name="productCodetbx" Width="250" Height="30" FontSize="15"
|
|
|
|
|
+ VerticalContentAlignment="Center"
|
|
|
|
|
+ Style="{StaticResource TextBox.SimpleWatermark}"
|
|
|
|
|
+ Tag="请输入产品码查询">
|
|
|
|
|
+```
|
|
|
|
|
+####
|
|
|
|
|
+- ToggleButton.Base
|
|
|
|
|
+- ToggleButton.Primary
|
|
|
|
|
+- ToggleButton.SimpleLamp
|
|
|
|
|
+```
|
|
|
|
|
+<ToggleButton
|
|
|
|
|
+ Width="100"
|
|
|
|
|
+ Height="40"
|
|
|
|
|
+ IsChecked="False"
|
|
|
|
|
+ Style="{StaticResource ToggleButton.SimpleLamp}"
|
|
|
|
|
+ Content="下柜灯"
|
|
|
|
|
+ Margin="0 2 0 2"/>
|
|
|
|
|
+```
|
|
|
|
|
+- ToggleButton.SimpleLocker
|
|
|
|
|
+```
|
|
|
|
|
+<ToggleButton
|
|
|
|
|
+ IsChecked="False"
|
|
|
|
|
+ FontSize="30"
|
|
|
|
|
+ Style="{StaticResource ToggleButton.SimpleLocker}"
|
|
|
|
|
+ Margin="0 10 0 2"
|
|
|
|
|
+ ToolTip="安全门锁"/>
|
|
|
|
|
+```
|
|
|
|
|
+- ToggleButton.ThemeSwitch
|
|
|
|
|
+```
|
|
|
|
|
+<ToggleButton
|
|
|
|
|
+ FontSize="30"
|
|
|
|
|
+ Style="{StaticResource ToggleButton.ThemeSwitch}"
|
|
|
|
|
+ Command="{Binding ThemeSwitchCommand}"
|
|
|
|
|
+ CommandParameter="{Binding Path=IsChecked,RelativeSource={RelativeSource Self}}"
|
|
|
|
|
+ Margin="10"
|
|
|
|
|
+ ToolTip="切换主题"/>
|
|
|
|
|
+```
|
|
|
|
|
+## 安装说明
|
|
|
|
|
+
|
|
|
|
|
+1. 克隆或下载本项目
|
|
|
|
|
+2. 可直接添加到目标项目使用
|
|
|
|
|
+
|
|
|
|
|
+## 依赖项
|
|
|
|
|
+
|
|
|
|
|
+- 纯手搓无非官方第三方依赖
|