123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340 |
- <Application
- x:Class="ShakerManger.App"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:convert="clr-namespace:ShakerManger.Convert"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerManger"
- xmlns:system="clr-namespace:System;assembly=mscorlib"
- xmlns:vm="clr-namespace:ShakerManger.ViewModel">
- <Application.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/AppResource;component/MangerResource.xaml" />
- <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
- <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <Style TargetType="ToolTip">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate>
- <StackPanel>
- <Path
- Margin="0,0,10,0"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Data="M 6 0 L 0 6 L 12 6 Z"
- Fill="#E6333333" />
- <Border
- HorizontalAlignment="Stretch"
- VerticalAlignment="Stretch"
- Background="#E6333333"
- CornerRadius="2">
- <TextBlock
- Margin="6"
- FontSize="12"
- Foreground="White"
- LineHeight="20"
- Text="{TemplateBinding ContentControl.Content}" />
- </Border>
- </StackPanel>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <vm:MainViewModelBindingProxy x:Key="MainViewModel" />
- <convert:MultiBoolConverter x:Key="MultiBoolConverter" />
- <convert:UserAllowClientIDConverter x:Key="UserAllowClientIDConverter" />
- <convert:Type2ViewConverter x:Key="Type2ViewConverter" />
- <convert:EnumToCollectionConverter x:Key="EnumToCollectionConverter" />
- <convert:OxyPlotColorToSolidBrushConverter x:Key="OxyPlotColorToSolidBrushConverter" />
- <vm:ColorPickerViewModel x:Key="ColorPicker" />
- <convert:EnumToDescription x:Key="EnumToDescription" />
- <convert:SilderDoubleConverter x:Key="SilderDoubleConverter" />
- <ControlTemplate x:Key="ComboBoxTemplate1" TargetType="ComboBox">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
- <Border
- x:Name="border"
- Grid.ColumnSpan="2"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}" />
- <hc:ToggleBlock
- Grid.Column="1"
- Padding="1,0"
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch"
- Background="Transparent"
- IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
- <hc:ToggleBlock.UnCheckedContent>
- <Path
- Width="14"
- Margin="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ThicknessSplitConverter}, ConverterParameter='0,0,1,0'}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Data="{StaticResource DownGeometry}"
- Fill="{TemplateBinding BorderBrush}"
- Stretch="Uniform" />
- </hc:ToggleBlock.UnCheckedContent>
- <hc:ToggleBlock.CheckedContent>
- <Path
- Width="14"
- Margin="{Binding Padding, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource ThicknessSplitConverter}, ConverterParameter='0,0,1,0'}"
- HorizontalAlignment="Right"
- VerticalAlignment="Center"
- Data="{StaticResource UpGeometry}"
- Fill="{TemplateBinding BorderBrush}"
- Stretch="Uniform" />
- </hc:ToggleBlock.CheckedContent>
- </hc:ToggleBlock>
- <hc:ToggleBlock
- Grid.Column="0"
- Grid.ColumnSpan="2"
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch"
- Background="Transparent"
- IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- ToggleGesture="LeftClick" />
- <ContentPresenter
- x:Name="contentPresenter"
- Grid.Column="0"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding SelectionBoxItem}"
- ContentStringFormat="{TemplateBinding SelectionBoxItemStringFormat}"
- ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
- ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
- IsHitTestVisible="false"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- <Popup
- x:Name="PART_Popup"
- Margin="1"
- AllowsTransparency="true"
- IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
- Placement="Bottom"
- PlacementTarget="{Binding ElementName=border}"
- PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}">
- <Decorator Margin="8,0">
- <Border
- x:Name="dropDownBorder"
- MinWidth="{Binding ActualWidth, ElementName=border}"
- MaxHeight="{TemplateBinding MaxDropDownHeight}"
- Margin="0,0,0,8"
- Background="{StaticResource ComboBoxPopBackColor}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="0,1,0,0"
- CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
- Effect="{StaticResource EffectShadow2}">
- <hc:ToggleBlock
- HorizontalContentAlignment="Stretch"
- VerticalContentAlignment="Stretch"
- IsChecked="{Binding HasItems, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWay}">
- <hc:ToggleBlock.CheckedContent>
- <ScrollViewer Margin="2">
- <ItemsPresenter
- x:Name="ItemsPresenter"
- KeyboardNavigation.DirectionalNavigation="Contained"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </ScrollViewer>
- </hc:ToggleBlock.CheckedContent>
- <hc:ToggleBlock.UnCheckedContent>
- <hc:Empty />
- </hc:ToggleBlock.UnCheckedContent>
- </hc:ToggleBlock>
- </Border>
- </Decorator>
- </Popup>
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="HasItems" Value="false">
- <Setter TargetName="dropDownBorder" Property="Height" Value="95" />
- </Trigger>
- <Trigger Property="hc:DropDownElement.ConsistentWidth" Value="True">
- <Setter TargetName="dropDownBorder" Property="MaxWidth" Value="{Binding ActualWidth, ElementName=border}" />
- <Setter TargetName="dropDownBorder" Property="MinWidth" Value="{Binding ActualWidth, ElementName=border}" />
- </Trigger>
- <Trigger Property="hc:DropDownElement.AutoWidth" Value="True">
- <Setter TargetName="dropDownBorder" Property="MaxWidth" Value="{x:Static system:Double.MaxValue}" />
- <Setter TargetName="dropDownBorder" Property="MinWidth" Value="{Binding ActualHeight, ElementName=border}" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsGrouping" Value="true" />
- <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false" />
- </MultiTrigger.Conditions>
- <Setter Property="ScrollViewer.CanContentScroll" Value="false" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="true" />
- <Condition SourceName="PART_Popup" Property="IsOpen" Value="false" />
- </MultiTrigger.Conditions>
- <Setter Property="BorderBrush" Value="{DynamicResource SecondaryBorderBrush}" />
- </MultiTrigger>
- <Trigger SourceName="PART_Popup" Property="IsOpen" Value="True">
- <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}" />
- </Trigger>
- <Trigger Property="IsFocused" Value="True">
- <Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter Property="Opacity" Value="0.4" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <Style x:Key="ComboBoxItemBaseStyle1" TargetType="ComboBoxItem">
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="Padding" Value="{StaticResource DefaultControlPadding}" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="BorderThickness" Value="0" />
- <Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="ComboBoxItem">
- <Border
- x:Name="Bd"
- Padding="{TemplateBinding Padding}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius), RelativeSource={RelativeSource TemplatedParent}}"
- Cursor="Hand">
- <ContentPresenter
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsSelected" Value="False" />
- <Condition Property="IsMouseOver" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="Green" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsSelected" Value="True" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Bd" Property="Background" Value="{DynamicResource PrimaryBrush}" />
- <Setter Property="Foreground" Value="White" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style
- x:Key="ComboBoxStyle1"
- TargetType="{x:Type ComboBox}"
- BasedOn="{StaticResource InputElementBaseStyle}">
- <Setter Property="ItemContainerStyle" Value="{StaticResource ComboBoxItemBaseStyle1}" />
- <Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
- <Setter Property="ScrollViewer.CanContentScroll" Value="true" />
- <Setter Property="ScrollViewer.PanningMode" Value="Both" />
- <Setter Property="Stylus.IsFlicksEnabled" Value="False" />
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="Template" Value="{StaticResource ComboBoxTemplate1}" />
- <Style.Triggers>
- <Trigger Property="IsEditable" Value="true">
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}" />
- </Trigger>
- </Style.Triggers>
- </Style>
- <Style TargetType="Button">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="6">
- <Label
- Margin="0"
- Padding="0"
- HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
- VerticalAlignment="{TemplateBinding VerticalAlignment}"
- HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
- Background="Transparent"
- BorderBrush="Transparent"
- BorderThickness="0"
- Content="{TemplateBinding Content}"
- FontFamily="{TemplateBinding FontFamily}"
- FontSize="{TemplateBinding FontSize}"
- FontStretch="{TemplateBinding FontStretch}"
- FontWeight="{TemplateBinding FontWeight}"
- Foreground="{TemplateBinding Foreground}" />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="Background" Value="{StaticResource ButtonBackColor}" />
- <Setter Property="Foreground" Value="{StaticResource NomalForeColor}" />
- <Setter Property="BorderBrush" Value="{StaticResource ButtonBorderColor}" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Style.Triggers>
- <Trigger Property="IsFocused" Value="True">
- <Setter Property="Background" Value="{StaticResource ButtonBorderColor}" />
- </Trigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- <Condition Property="IsFocused" Value="True" />
- </MultiTrigger.Conditions>
- <Setter Property="Foreground" Value="{StaticResource ButtonFocusedColor}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="IsMouseOver" Value="True" />
- <Condition Property="IsFocused" Value="False" />
- </MultiTrigger.Conditions>
- <Setter Property="Background" Value="{StaticResource ButtonBorderColor}" />
- </MultiTrigger>
- </Style.Triggers>
- </Style>
- <Style
- x:Key="ImageButton"
- TargetType="Button"
- BasedOn="{StaticResource ButtonIcon}">
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="Button">
- <Border Background="{TemplateBinding Background}">
- <Viewbox
- Width="{TemplateBinding hc:IconElement.Width}"
- Height="{TemplateBinding hc:IconElement.Height}"
- Cursor="Hand">
- <Path Data="{TemplateBinding hc:IconElement.Geometry}" Fill="{TemplateBinding Foreground}" />
- </Viewbox>
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- <Setter Property="Cursor" Value="Hand" />
- <Setter Property="Foreground" Value="{StaticResource NomalForeColor}" />
- <Setter Property="BorderBrush" Value="Transparent" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Foreground" Value="{StaticResource ButtonFocusedColor}" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </ResourceDictionary>
- </Application.Resources>
- </Application>
|