123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373 |
- <Application
- x:Class="ShakerControl.App"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:convert="clr-namespace:ShakerControl.Convert"
- xmlns:hc="https://handyorg.github.io/handycontrol"
- xmlns:local="clr-namespace:ShakerControl"
- xmlns:system="clr-namespace:System;assembly=mscorlib"
- xmlns:view="clr-namespace:ShakerControl.ViewModel.DataManger"
- xmlns:vm="clr-namespace:ShakerControl.ViewModel">
- <Application.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/AppResource;component/Resource.xaml" />
- <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
- <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
- </ResourceDictionary.MergedDictionaries>
- <system:Double x:Key="WindowWidth">1024</system:Double>
- <system:Double x:Key="WindowHeight">768</system:Double>
- <vm:MainViewModelBindingProxy x:Key="MainViewModel" />
- <vm:BindingProxy x:Key="Prompt" Data="{x:Static vm:PromptViewModel.Default}" />
- <convert:Type2ViewConverter x:Key="Type2ViewConverter" />
- <convert:EnumToCollectionConverter x:Key="EnumToCollectionConverter" />
- <convert:EnumToDescription x:Key="EnumToDescription" />
- <convert:SilderDoubleConverter x:Key="SilderDoubleConverter" />
- <convert:GetItemConverter x:Key="GetItemConverter" />
- <convert:OxyPlotColorToSolidBrushConverter x:Key="OxyPlotColorToSolidBrushConverter" />
- <view:ColorPickerViewModel x:Key="ColorPicker" />
- <ControlTemplate x:Key="SliderThumb1" TargetType="{x:Type Thumb}">
- <hc:AxleCanvas>
- <Border
- x:Name="BorderDot"
- Canvas.Bottom="0"
- Width="{TemplateBinding Width}"
- Height="{TemplateBinding Height}"
- Margin="0"
- Background="{DynamicResource PrimaryBrush}"
- BorderBrush="{TemplateBinding BorderBrush}"
- CornerRadius="6" />
- </hc:AxleCanvas>
- <ControlTemplate.Triggers>
- <EventTrigger RoutedEvent="UIElement.PreviewMouseLeftButtonDown">
- <BeginStoryboard>
- <Storyboard>
- <ThicknessAnimation
- Storyboard.TargetName="BorderDot"
- Storyboard.TargetProperty="BorderThickness"
- To="2"
- Duration="0:0:.1" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- <EventTrigger RoutedEvent="UIElement.PreviewMouseLeftButtonUp">
- <BeginStoryboard>
- <Storyboard>
- <ThicknessAnimation
- Storyboard.TargetName="BorderDot"
- Storyboard.TargetProperty="BorderThickness"
- To="0"
- Duration="0:0:.1" />
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <Style x:Key="RepeatButtonStyle1" TargetType="{x:Type RepeatButton}">
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Border
- Width="{TemplateBinding Width}"
- Height="{TemplateBinding Height}"
- Background="Transparent" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <Style x:Key="RepeatButtonStyle2" TargetType="{x:Type RepeatButton}">
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Background" Value="Transparent" />
- <Setter Property="Focusable" Value="false" />
- <Setter Property="IsTabStop" Value="false" />
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type RepeatButton}">
- <Border
- Width="{TemplateBinding Width}"
- Height="{TemplateBinding Height}"
- Background="{TemplateBinding Background}"
- CornerRadius="6,0,0,6" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <ControlTemplate x:Key="SliderStyle" TargetType="{x:Type Slider}">
- <Border
- Background="Transparent"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="6">
- <Grid>
- <Track x:Name="PART_Track" Margin="0">
- <Track.DecreaseRepeatButton>
- <RepeatButton
- Background="{TemplateBinding Background}"
- Command="{x:Static Slider.DecreaseLarge}"
- Style="{StaticResource RepeatButtonStyle2}" />
- </Track.DecreaseRepeatButton>
- <Track.IncreaseRepeatButton>
- <RepeatButton Command="{x:Static Slider.IncreaseLarge}" Style="{StaticResource RepeatButtonStyle1}" />
- </Track.IncreaseRepeatButton>
- <Track.Thumb>
- <Thumb
- x:Name="Thumb"
- Width="18"
- Height="{TemplateBinding Height}"
- VerticalAlignment="Center"
- ClipToBounds="False"
- Focusable="False"
- OverridesDefaultStyle="True"
- Template="{StaticResource SliderThumb1}" />
- </Track.Thumb>
- </Track>
- <TextBlock
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- FontFamily="{TemplateBinding FontFamily}"
- FontSize="{TemplateBinding FontSize}"
- FontStretch="{TemplateBinding FontStretch}"
- FontStyle="{TemplateBinding FontStyle}"
- FontWeight="{TemplateBinding FontWeight}"
- Foreground="{TemplateBinding Foreground}"
- IsHitTestVisible="False"
- Text="{Binding Value, Converter={StaticResource SilderDoubleConverter}, RelativeSource={RelativeSource TemplatedParent}, StringFormat={}{0}%}" />
- </Grid>
- </Border>
- <ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="hc:TipElement.Placement" Value="Top" />
- <Condition Property="hc:TipElement.Visibility" Value="Visible" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Thumb" Property="Template" Value="{StaticResource TipSliderThumbHorizontalTop}" />
- </MultiTrigger>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="hc:TipElement.Placement" Value="Bottom" />
- <Condition Property="hc:TipElement.Visibility" Value="Visible" />
- </MultiTrigger.Conditions>
- <Setter TargetName="Thumb" Property="Template" Value="{StaticResource TipSliderThumbHorizontalBottom}" />
- </MultiTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- <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 InfoBrush}"
- 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"
- BasedOn="{StaticResource InputElementBaseStyle}"
- TargetType="{x:Type ComboBox}">
- <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
- x:Key="PowerAmplifierButtonStyle"
- BasedOn="{StaticResource ButtonIcon}"
- TargetType="Button">
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter Property="Foreground" Value="CadetBlue" />
- </Trigger>
- </Style.Triggers>
- </Style>
- </ResourceDictionary>
- </Application.Resources>
- </Application>
|