|
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:con="clr-namespace:BeDesignerSCADA.Converters"
- xmlns:ctrl="clr-namespace:BeDesignerSCADA.CustomerControls"
- xmlns:dxmvmm="clr-namespace:BeDesignerSCADA.Converters"
- xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
- xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore">
-
- <!--#region 主题笔刷-->
- <LinearGradientBrush x:Key="NormalBackground" StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStopCollection>
- <GradientStop Color="White" />
- <GradientStop Offset="0.5" Color="#D0D0D0" />
- <GradientStop Offset="1" Color="#E3E3E3" />
- </GradientStopCollection>
- </LinearGradientBrush>
-
- <SolidColorBrush x:Key="AccentBrush" Color="#2B79E2" />
- <SolidColorBrush x:Key="ControlBorderBrush" Color="LightGray" />
- <SolidColorBrush x:Key="ControlBackground" Color="White" />
- <SolidColorBrush x:Key="ControlForeground" Color="Black" />
- <!--#endregion-->
-
- <!--#region 转换器-->
- <con:HalfNumberConverter x:Key="HalfNumber" />
- <!--#endregion-->
-
- <!--#region 编辑模板-->
- <DataTemplate x:Key="EventEditTemplate">
- <DockPanel Height="24">
- <Button
- Margin="2"
- Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
- CommandParameter="{Binding .}"
- Content="..."
- DockPanel.Dock="Right" />
- <TextBlock
- Margin="4,0,0,0"
- VerticalAlignment="Center"
- Text="{Binding Value}" />
- </DockPanel>
- </DataTemplate>
-
- <DataTemplate x:Key="ListEditTemplate">
- <DockPanel MaxHeight="100">
- <DockPanel DockPanel.Dock="Top">
- <Button
- Margin="2"
- Padding="2"
- Command="{Binding Value.AddCommand}"
- CommandParameter="{Binding ElementName=AddTxt, Path=Text}"
- DockPanel.Dock="Right">
- <icon:PackIconModern Kind="EditAdd" />
- </Button>
- <Button
- Margin="2"
- Padding="2"
- Command="{Binding Value.DeleteCommand}"
- CommandParameter="{Binding ElementName=list, Path=SelectedItem}"
- DockPanel.Dock="Right">
- <icon:PackIconModern Kind="Delete" />
- </Button>
- <TextBox x:Name="AddTxt" Margin="2" />
- </DockPanel>
-
- <ListBox
- x:Name="list"
- Margin="2"
- ItemsSource="{Binding Value}" />
- </DockPanel>
- </DataTemplate>
-
- <DataTemplate x:Key="ImagePathEditTemplate">
- <DockPanel>
- <Button
- Width="20"
- Height="20"
- Margin="2"
- Padding="0"
- Command="{Binding DataContext.SelectPathCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
- CommandParameter="{Binding .}"
- Content="..."
- DockPanel.Dock="Right" />
- <TextBox
- x:Name="AddTxt"
- BorderThickness="0"
- DockPanel.Dock="Right"
- Text="{Binding Value}" />
- </DockPanel>
- </DataTemplate>
- <!--#endregion-->
-
- <!--#region 为某些获取焦点的控件设计设计时样式-->
- <Style x:Key="DesignComboBox" TargetType="ComboBox">
- <Setter Property="Focusable" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ComboBox">
- <Border BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <Border Background="{StaticResource ControlBackground}" />
- <Border
- Grid.Column="1"
- Background="{StaticResource ControlBackground}"
- BorderThickness="0"
- IsEnabled="False">
- <Path
- Margin="3"
- VerticalAlignment="Center"
- Data="M0,0 8,0 4,4z"
- Fill="{StaticResource ControlForeground}" />
- </Border>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <!--<Style TargetType="Button" x:Key="DesignButton">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border BorderThickness="1" BorderBrush="{StaticResource ControlBorderBrush}" Background="{StaticResource ControlBackground}">
- <TextBlock Text="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}"
- FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>-->
-
- <Style x:Key="DesignToggleButton" TargetType="ToggleButton">
- <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border
- Background="{StaticResource NormalBackground}"
- BorderBrush="{StaticResource ControlBorderBrush}"
- BorderThickness="1"
- CornerRadius="2">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{TemplateBinding FontSize}"
- FontWeight="{TemplateBinding FontWeight}"
- Text="{TemplateBinding Content}" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style x:Key="ExecuteToggleButton" TargetType="ToggleButton">
- <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
- <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border
- x:Name="bd"
- Background="{StaticResource NormalBackground}"
- BorderBrush="{StaticResource ControlBorderBrush}"
- BorderThickness="1"
- CornerRadius="2">
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontSize="{TemplateBinding FontSize}"
- FontWeight="{TemplateBinding FontWeight}"
- Text="{TemplateBinding Content}" />
- </Border>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="bd" Property="Background">
- <Setter.Value>
- <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
- <GradientStopCollection>
- <GradientStop Color="#6AD456" />
- <GradientStop Offset="0.5" Color="#1DAE06" />
- <GradientStop Offset="1" Color="#8BDC7C" />
- </GradientStopCollection>
- </LinearGradientBrush>
- </Setter.Value>
- </Setter>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <!--#endregion-->
-
- <DataTemplate x:Key="ToolBoxStyle">
- <Grid Margin="2" Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="30" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <icon:PackIconMaterial
- x:Name="icon"
- Width="24"
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- BorderThickness="1"
- Kind="Ellipse" />
- <TextBlock
- x:Name="txt"
- Grid.Column="1"
- Margin="4"
- Text="{Binding Name}" />
- </Grid>
-
- <DataTemplate.Triggers>
- <DataTrigger Binding="{Binding Name}" Value="TheButton">
- <Setter TargetName="icon" Property="Kind" Value="GestureTapButton" />
- <Setter TargetName="txt" Property="Text" Value="按钮" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheTimer">
- <Setter TargetName="icon" Property="Kind" Value="Timer" />
- <Setter TargetName="txt" Property="Text" Value="计时器" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheCheckBox">
- <Setter TargetName="icon" Property="Kind" Value="CheckboxMarked" />
- <Setter TargetName="txt" Property="Text" Value="勾选框" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="DigitalNumber">
- <Setter TargetName="icon" Property="Kind" Value="LedStrip" />
- <Setter TargetName="txt" Property="Text" Value="液晶数字" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheComboBox">
- <Setter TargetName="icon" Property="Kind" Value="ViewList" />
- <Setter TargetName="txt" Property="Text" Value="下拉框" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheImage">
- <Setter TargetName="icon" Property="Kind" Value="Image" />
- <Setter TargetName="txt" Property="Text" Value="图片" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheTextBlock">
- <Setter TargetName="icon" Property="Kind" Value="TagText" />
- <Setter TargetName="txt" Property="Text" Value="文本块" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="ArcGauge">
- <Setter TargetName="icon" Property="Kind" Value="Gauge" />
- <Setter TargetName="txt" Property="Text" Value="仪表盘" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="StatusLight">
- <Setter TargetName="icon" Property="Kind" Value="CeilingLight" />
- <Setter TargetName="txt" Property="Text" Value="状态灯" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheToggleButton">
- <Setter TargetName="icon" Property="Kind" Value="CheckOutline" />
- <Setter TargetName="txt" Property="Text" Value="开关按钮" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheGroupBox">
- <Setter TargetName="icon" Property="Kind" Value="Group" />
- <Setter TargetName="txt" Property="Text" Value="分组" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheTextBox">
- <Setter TargetName="icon" Property="Kind" Value="TextBox" />
- <Setter TargetName="txt" Property="Text" Value="文本框" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="NumberBox">
- <Setter TargetName="icon" Property="Kind" Value="Numeric8Box" />
- <Setter TargetName="txt" Property="Text" Value="数值框" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="GraphArrow">
- <Setter TargetName="icon" Property="Kind" Value="ArrowRightBold" />
- <Setter TargetName="txt" Property="Text" Value="箭头" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="GraphStar">
- <Setter TargetName="icon" Property="Kind" Value="Star" />
- <Setter TargetName="txt" Property="Text" Value="五角星" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheSlider">
- <Setter TargetName="icon" Property="Kind" Value="ArrowDownBold" />
- <Setter TargetName="txt" Property="Text" Value="滑块" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheRadioButton">
- <Setter TargetName="icon" Property="Kind" Value="RadioboxMarked" />
- <Setter TargetName="txt" Property="Text" Value="单选按钮" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="SwitchButton">
- <Setter TargetName="icon" Property="Kind" Value="ToggleSwitch" />
- <Setter TargetName="txt" Property="Text" Value="开关" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="KnobButton">
- <Setter TargetName="icon" Property="Kind" Value="Ellipse" />
- <Setter TargetName="txt" Property="Text" Value="旋钮" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="Silos">
- <Setter TargetName="icon" Property="Kind" Value="StoreSettings" />
- <Setter TargetName="txt" Property="Text" Value="物料仓" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="NewConveyorBelt">
- <Setter TargetName="icon" Property="Kind" Value="Attachment" />
- <Setter TargetName="txt" Property="Text" Value="滚动线" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheDataGrid">
- <Setter TargetName="icon" Property="Kind" Value="BorderAll" />
- <Setter TargetName="txt" Property="Text" Value="表格" />
- </DataTrigger>
- <DataTrigger Binding="{Binding Name}" Value="TheListBox">
- <Setter TargetName="icon" Property="Kind" Value="ViewHeadline" />
- <Setter TargetName="txt" Property="Text" Value="列表控件" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheRedis">
- <Setter TargetName="icon" Property="Kind" Value="AlphaDBoxOutline" />
- <Setter TargetName="txt" Property="Text" Value="Redis控件" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="WaveProgressBar">
- <Setter TargetName="icon" Property="Kind" Value="Wave" />
- <Setter TargetName="txt" Property="Text" Value="进度条波浪" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheProgressBar">
- <Setter TargetName="icon" Property="Kind" Value="Texture" />
- <Setter TargetName="txt" Property="Text" Value="进度条正常" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheRedProgressBar">
- <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
- <Setter TargetName="txt" Property="Text" Value="进度条圆形红" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheBlueProgressBar">
- <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
- <Setter TargetName="txt" Property="Text" Value="进度条圆形蓝" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheGreenProgressBar">
- <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
- <Setter TargetName="txt" Property="Text" Value="进度条圆形绿" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheAPI">
- <Setter TargetName="icon" Property="Kind" Value="AlphaABoxOutline" />
- <Setter TargetName="txt" Property="Text" Value="API接口" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheMQTT">
- <Setter TargetName="icon" Property="Kind" Value="AlphaMBoxOutline" />
- <Setter TargetName="txt" Property="Text" Value="MQTT" />
- </DataTrigger>
-
- <DataTrigger Binding="{Binding Name}" Value="TheTabControl">
- <Setter TargetName="icon" Property="Kind" Value="PeriodicTable" />
- <Setter TargetName="txt" Property="Text" Value="选项卡控件" />
- </DataTrigger>
-
- </DataTemplate.Triggers>
- </DataTemplate>
-
- <FontFamily x:Key="Digital">
- pack://application:,,,/Fonts/#DS-Digital
- </FontFamily>
-
- <!--#region 右键菜单-->
- <ContextMenu
- x:Key="CanvasRightMenu"
- DataContext="{Binding PlacementTarget, RelativeSource={RelativeSource Self}}"
- FontFamily="Microsoft YaHei Ui">
- <MenuItem Command="{Binding CopySelectItemsCommand}" Header="复制">
- <MenuItem.Icon>
- <icon:PackIconModern
- Width="10"
- HorizontalAlignment="Center"
- Kind="PageCopy" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Command="{Binding PasteSelectItemsCommand}" Header="粘贴">
- <MenuItem.Icon>
- <icon:PackIconModern
- Width="10"
- HorizontalAlignment="Center"
- Kind="ClipboardPaste" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Command="{Binding DeleteSelectItemsCommand}" Header="删除">
- <MenuItem.Icon>
- <icon:PackIconModern
- Width="10"
- HorizontalAlignment="Center"
- Kind="Delete" />
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
-
- <ContextMenu
- x:Key="AdornerRightMenu"
- DataContext="{Binding PlacementTarget.Tag, RelativeSource={RelativeSource Mode=Self}}"
- FontFamily="Microsoft YaHei Ui">
- <MenuItem Command="{Binding CopySelectItemsCommand}" Header="复制">
- <MenuItem.Icon>
- <icon:PackIconModern
- Width="10"
- HorizontalAlignment="Center"
- Kind="PageCopy" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Command="{Binding PasteSelectItemsCommand}" Header="粘贴">
- <MenuItem.Icon>
- <icon:PackIconModern
- Width="10"
- HorizontalAlignment="Center"
- Kind="ClipboardPaste" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Command="{Binding DeleteSelectItemsCommand}" Header="删除">
- <MenuItem.Icon>
- <icon:PackIconModern
- Width="10"
- HorizontalAlignment="Center"
- Kind="Delete" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Command="{Binding SetTopLayerCommand}" Header="置于顶层">
- <MenuItem.Icon>
- <icon:PackIconMaterial
- Width="10"
- HorizontalAlignment="Center"
- Kind="ArrangeSendToBack" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Command="{Binding SetBottomLayerCommand}" Header="置于底层">
- <MenuItem.Icon>
- <icon:PackIconMaterial
- Width="10"
- HorizontalAlignment="Center"
- Kind="ArrangeBringToFront" />
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
-
- <!--#endregion-->
-
- <!--#region 控件集合-->
- <!--<Style TargetType="ctrl:DigitalNumber">
- <Setter Property="Background" Value="#FF1A1E22"/>
- <Setter Property="Foreground" Value="#FF0AA74D"/>
- <Setter Property="NumberValue" Value="0.01"/>
- <Setter Property="FontSize" Value="20"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ctrl:DigitalNumber">
- <Grid Background="{TemplateBinding Background}">
- <TextBlock x:Name="line" VerticalAlignment="Center" HorizontalAlignment="Center"
- FontFamily="{StaticResource Digital}" FontSize="{TemplateBinding FontSize}"
- Text="{Binding NumberValue,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ctrl:DigitalNumber},Mode=TwoWay}"
- Foreground="{TemplateBinding Foreground}"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style TargetType="{x:Type ctrl:TheTimer}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ctrl:TheTimer}">
- <Border Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}">
- <Grid>
- <Image Source="../Images/timericon.png" RenderOptions.BitmapScalingMode="Fant"/>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
-
- <Style TargetType="{x:Type ctrl:StatusLight}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ctrl:StatusLight}">
- <Border Width="{Binding Path=ActualHeight,RelativeSource={RelativeSource Self}}">
- <Grid>
- <Image x:Name="ima" Source="../Images/State0.png" RenderOptions.BitmapScalingMode="Fant">
- </Image>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style TargetType="{x:Type ctrl:ArcGauge}">
- <Setter Property="Background" Value="#646464"/>
- <Setter Property="Foreground" Value="Black"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ctrl:ArcGauge}">
- <Border Margin="10">
- <Grid Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}">
- <Ellipse Fill="#FF3B3B3B"/>
- <Grid RenderTransformOrigin="0.5,0.5" Margin="2">
- <Grid.RenderTransform>
- <TransformGroup>
- <RotateTransform Angle="{Binding Path=Angle,ElementName=PointRotate}"/>
- </TransformGroup>
- </Grid.RenderTransform>
- <Ellipse Width="16" Height="14" Fill="Orange" VerticalAlignment="Top" >
- <Ellipse.Effect>
- <BlurEffect Radius="12"/>
- </Ellipse.Effect>
- </Ellipse>
- </Grid>
-
- <Grid x:Name="bdGrid" Margin="12" UseLayoutRounding="True" ClipToBounds="True">
- <Ellipse>
- <Ellipse.Fill>
- <RadialGradientBrush>
- <GradientStop Color="#4D000000"/>
- </RadialGradientBrush>
- </Ellipse.Fill>
- </Ellipse>
-
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition Width="2*"/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition Height="2*"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Ellipse Stroke="#464646" StrokeThickness="1" Grid.Column="1" Grid.Row="1"/>
- <Ellipse Stroke="#959595" Margin="4" StrokeThickness="6" Grid.Column="1" Grid.Row="1"/>
- <Ellipse Stroke="#464646" Margin="14" StrokeThickness="1" Grid.Column="1" Grid.Row="1"/>
- </Grid>
-
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Path Data="M5,0 5,0 10,120 0,120z" Fill="#0FA9CE" Stretch="Uniform" Margin="0 30 0 0" RenderTransformOrigin="0.5,1" HorizontalAlignment="Center">
- <Path.RenderTransform>
- <TransformGroup>
- <RotateTransform x:Name="PointRotate"/>
- </TransformGroup>
- </Path.RenderTransform>
- </Path>
- </Grid>
-
- <Ellipse Width="28" Height="28" Fill="Black">
- <Ellipse.Effect>
- <DropShadowEffect Color="#0FA9CE" ShadowDepth="0" Direction="0" BlurRadius="16"/>
- </Ellipse.Effect>
- </Ellipse>
-
- <Border VerticalAlignment="Bottom" BorderBrush="#10ABD1" BorderThickness="2" Margin="0 0 0 12" Background="Black" Padding="4 2" HorizontalAlignment="Center">
- <TextBlock Text="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent},StringFormat={}{0:f1}}" FontSize="16" Width="46" TextAlignment="Center" Foreground="White"/>
- </Border>
- </Grid>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style TargetType="{x:Type ctrl:TheTextBox}" BasedOn="{StaticResource {x:Type TextBox}}"/>
-
- <Style x:Key="DesignTheTextBox" TargetType="{x:Type ctrl:TheTextBox}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ctrl:TheTextBox">
- <Border BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1" Background="{StaticResource ControlBackground}">
- <TextBlock Margin="4 0 0 0" Text="{TemplateBinding Text}" VerticalAlignment="Center"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style TargetType="{x:Type ctrl:NumberBox}" BasedOn="{StaticResource {x:Type TextBox}}">
- <Setter Property="input:InputMethod.IsInputMethodEnabled" Value="False"/>
- </Style>
-
- <Style x:Key="DesignNumberBox" TargetType="{x:Type ctrl:NumberBox}">
- <Setter Property="input:InputMethod.IsInputMethodEnabled" Value="False"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ctrl:NumberBox">
- <Border BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1" Background="{StaticResource ControlBackground}">
- <TextBlock Margin="4 0 0 0" Text="{TemplateBinding Text}" VerticalAlignment="Center" Foreground="BlueViolet"/>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
- <Style TargetType="{x:Type ctrl:TheSlider}" BasedOn="{StaticResource {x:Type Slider}}">
- <Setter Property="Width" Value="140"/>
- <Setter Property="Maximum" Value="100"/>
- <Setter Property="IsSnapToTickEnabled" Value="True"/>
- <Setter Property="Minimum" Value="0"/>
- <Setter Property="AutoToolTipPlacement" Value="BottomRight"/>
- <Setter Property="SmallChange" Value="0.1"/>
- <Setter Property="LargeChange" Value="0.1"/>
- </Style>
-
-
- <Style TargetType="{x:Type ctrl:TheRadioButton}" BasedOn="{StaticResource {x:Type RadioButton}}">
- <Setter Property="VerticalContentAlignment" Value="Center" />
- </Style>
-
- <Style TargetType="{x:Type ctrl:WaveProgressBar}">
- <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
- <Setter Property="BorderThickness" Value="1"/>
- <Setter Property="WaveFill" Value="#36E7AE"/>
- <Setter Property="WaveThickness" Value="2"/>
- <Setter Property="WaveStroke" Value="#3649E7"/>
- <Setter Property="ShowText" Value="True" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ctrl:WaveProgressBar">
- <ControlTemplate.Resources>
- <Storyboard x:Key="StoryboardOnLoaded" RepeatBehavior="Forever">
- <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)" Storyboard.TargetName="PART_Wave">
- <EasingDoubleKeyFrame KeyTime="0:0:2" Value="-400"/>
- </DoubleAnimationUsingKeyFrames>
- </Storyboard>
- </ControlTemplate.Resources>
- <StackPanel>
- <Border Background="{TemplateBinding Background}">
- <Viewbox>
- <Border x:Name="PART_Clip" BorderThickness="{TemplateBinding BorderThickness}" ClipToBounds="True"
- BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="100" Width="200" Height="200">
- <Border.Clip>
- <EllipseGeometry RadiusX="100" RadiusY="100" Center="100,100"/>
- </Border.Clip>
- <Grid>
- <Path x:Name="PART_Wave" Stroke="{TemplateBinding WaveStroke}" ClipToBounds="True" StrokeThickness="{TemplateBinding WaveThickness}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="250" Fill="{TemplateBinding WaveFill}" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" Margin="0,0,-400,-20">
- <Path.Data>
- <PathGeometry>
- <PathFigure StartPoint="0,1">
- <PolyBezierSegment Points="0.5,1 0.5,0 1,0"/>
- <PolyBezierSegment Points="1.5,0 1.5,1 2,1"/>
- <PolyBezierSegment Points="2.5,1 2.5,0 3,0"/>
- <PolyLineSegment Points="3,0 3,10, 0,10 0,1"/>
- </PathFigure>
- </PathGeometry>
- </Path.Data>
- </Path>
- <TextBlock Visibility="{Binding ShowText,RelativeSource={RelativeSource TemplatedParent},Converter={x:Static dxmvmm:BoolToVisibilityConverter.Instance}}"
- HorizontalAlignment="Center" VerticalAlignment="Center"
- Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}"
- Text="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent},StringFormat={}{0:f2}%}"/>
- </Grid>
-
- </Border>
- </Viewbox>
- </Border>
-
- </StackPanel>
- <ControlTemplate.Triggers>
- <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="PART_Wave">
- <BeginStoryboard Name="BeginStoryboardWave" Storyboard="{StaticResource StoryboardOnLoaded}"/>
- </EventTrigger>
- <EventTrigger RoutedEvent="FrameworkElement.Unloaded" SourceName="PART_Wave">
- <StopStoryboard BeginStoryboardName="BeginStoryboardWave"/>
- </EventTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
-
- <Style TargetType="{x:Type ctrl:SwitchButton}">
- <Setter Property="Background" Value="#00F4D5"/>
- <Setter Property="BorderBrush" Value="LightGray"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ctrl:SwitchButton">
- <Border CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=ActualHeight,Converter={StaticResource HalfNumber}}"
- BorderThickness="1" Background="{StaticResource ControlBackground}" BorderBrush="{TemplateBinding BorderBrush}">
- <Grid>
- <Ellipse x:Name="ELLIPSE" HorizontalAlignment="Left" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5"
- Fill="Gray" Stroke="{StaticResource ControlBorderBrush}" StrokeThickness="1">
- <Ellipse.RenderTransform>
- <TransformGroup>
- <TranslateTransform x:Name="TranslateX" X="2"/>
- </TransformGroup>
- </Ellipse.RenderTransform>
- </Ellipse>
- </Grid>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
-
-
- <Style TargetType="{x:Type ctrl:KnobButton}">
- <Setter Property="Background" Value="#0068F4"/>
- <Setter Property="BorderBrush" Value="LightGray"/>
- <Setter Property="Foreground" Value="Black"/>
- <Setter Property="FontSize" Value="20"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ctrl:KnobButton">
- <Grid x:Name="bdGrid" Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}">
- <Grid Margin="16" RenderTransformOrigin="0.5,0.5">
- <Grid.RenderTransform>
- <RotateTransform x:Name="rotatevalue" Angle="00"/>
- </Grid.RenderTransform>
-
- <Ellipse Margin="4" Fill="#FFF6F6F6" Stroke="{StaticResource ControlBorderBrush}" >
- <Ellipse.Effect>
- <DropShadowEffect ShadowDepth="2" BlurRadius="8" Direction="-90" Color="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=Background.(SolidColorBrush.Color)}"/>
- </Ellipse.Effect>
- </Ellipse>
- <Ellipse Margin="12" Fill="{TemplateBinding Background}" Width="8" Height="8" VerticalAlignment="Bottom">
- </Ellipse>
- </Grid>
- <TextBlock Text="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent}, StringFormat={}{0:F2}}"
- VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}"/>
- </Grid>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>-->
- <!--#endregion-->
-
- <!--#region 控制集合-->
- <Style TargetType="{x:Type ToggleButton}">
- <Setter Property="Foreground" Value="White" />
- <Setter Property="FontFamily" Value="Microsoft YaHei" />
- <Setter Property="FontSize" Value="12" />
- <Setter Property="FontWeight" Value="Bold" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ToggleButton">
- <Border
- BorderBrush="{TemplateBinding Control.BorderBrush}"
- BorderThickness="0"
- CornerRadius="2">
- <Border.Background>
- <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
- <GradientStop Offset="0.0" Color="#FF71E0C6" />
- <GradientStop Offset="0.2" Color="#FF43A88D" />
- <GradientStop Offset="0.0" Color="#FF5BB07D" />
- </LinearGradientBrush>
- </Border.Background>
- <ContentPresenter
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- Content="{TemplateBinding ContentControl.Content}" />
- </Border>
- <ControlTemplate.Triggers>
-
- <Trigger Property="ButtonBase.IsPressed" Value="True">
- <Setter Property="UIElement.Effect">
- <Setter.Value>
- <DropShadowEffect
- BlurRadius="10"
- Direction="0"
- Opacity="0.9"
- RenderingBias="Performance"
- ShadowDepth="0"
- Color="#276AB0" />
- </Setter.Value>
- </Setter>
- <Setter Property="RenderTransform">
- <Setter.Value>
- <ScaleTransform ScaleX="0.9" ScaleY="0.9" />
- </Setter.Value>
- </Setter>
- <Setter Property="RenderTransformOrigin" Value=".5,.5" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
-
- </Setter.Value>
- </Setter>
- </Style>
- <DataTemplate x:Key="Category">
- <TextBlock
- FontSize="20"
- Foreground="#4EB9E4"
- Text="{Binding}" />
- </DataTemplate>
- <!--#endregion-->
- </ResourceDictionary>
|