add style and demo
This commit is contained in:
1 parent
1b49c516c3
commit
61c5044b6f
25 files changed
+310
-69
No files matched your search
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -528,7 +527,7 @@
|
|||||||
|
|
||||||
<!--下拉框扩展样式-->
|
<!--下拉框扩展样式-->
|
||||||
<Style x:Key="ComboBoxExtendBaseStyle" BasedOn="{StaticResource ComboBoxBaseStyle}" TargetType="ComboBox">
|
<Style x:Key="ComboBoxExtendBaseStyle" BasedOn="{StaticResource ComboBoxBaseStyle}" TargetType="ComboBox">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="Template" Value="{StaticResource ComboBoxTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource ComboBoxTopTemplate}"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -486,7 +485,7 @@
|
|||||||
|
|
||||||
<!--下拉框扩展样式-->
|
<!--下拉框扩展样式-->
|
||||||
<Style x:Key="ComboBoxExtendBaseStyle" BasedOn="{StaticResource ComboBoxBaseStyle}" TargetType="ComboBox">
|
<Style x:Key="ComboBoxExtendBaseStyle" BasedOn="{StaticResource ComboBoxBaseStyle}" TargetType="ComboBox">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="Template" Value="{StaticResource ComboBoxTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource ComboBoxTopTemplate}"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -528,7 +527,7 @@
|
|||||||
|
|
||||||
<!--下拉框扩展样式-->
|
<!--下拉框扩展样式-->
|
||||||
<Style x:Key="ComboBoxExtendBaseStyle" BasedOn="{StaticResource ComboBoxBaseStyle}" TargetType="ComboBox">
|
<Style x:Key="ComboBoxExtendBaseStyle" BasedOn="{StaticResource ComboBoxBaseStyle}" TargetType="ComboBox">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="Template" Value="{StaticResource ComboBoxTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource ComboBoxTopTemplate}"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
|
|||||||
@@ -53,6 +53,16 @@ namespace HandyControlDemo
|
|||||||
Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml")
|
Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml")
|
||||||
});
|
});
|
||||||
Current.MainWindow?.OnApplyTemplate();
|
Current.MainWindow?.OnApplyTemplate();
|
||||||
|
|
||||||
|
Resources.MergedDictionaries.Clear();
|
||||||
|
Resources.MergedDictionaries.Add(new ResourceDictionary
|
||||||
|
{
|
||||||
|
Source = new Uri($"pack://application:,,,/HandyControl;component/Themes/Skin{skin.ToString()}.xaml")
|
||||||
|
});
|
||||||
|
Resources.MergedDictionaries.Add(new ResourceDictionary
|
||||||
|
{
|
||||||
|
Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Theme.xaml")
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\ChatBox.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\ChatBox.xaml.cs">
|
||||||
<DependentUpon>ChatBox.xaml</DependentUpon>
|
<DependentUpon>ChatBox.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\CustomSplitButtonItem.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\IFull.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\IFull.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\InteractiveDialog.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\InteractiveDialog.xaml.cs">
|
||||||
<DependentUpon>InteractiveDialog.xaml</DependentUpon>
|
<DependentUpon>InteractiveDialog.xaml</DependentUpon>
|
||||||
@@ -341,6 +342,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\PaginationDemoViewModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\PaginationDemoViewModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SearchBarDemoViewModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SearchBarDemoViewModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SideMenuDemoViewModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SideMenuDemoViewModel.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SplitButtonDemoViewModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SpriteDemoViewModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SpriteDemoViewModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\StepBarDemoViewModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\StepBarDemoViewModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\TabControlDemoViewModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\TabControlDemoViewModel.cs" />
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol">
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||||
@@ -98,4 +99,6 @@
|
|||||||
<Setter Property="Padding" Value="25"/>
|
<Setter Property="Padding" Value="25"/>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style BasedOn="{StaticResource ComboBoxItemBaseStyle}" TargetType="userControl:CustomSplitButtonItem"/>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
using System.Windows.Controls;
|
||||||
|
using HandyControl.Controls;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.UserControl
|
||||||
|
{
|
||||||
|
public class CustomSplitButtonItem : ComboBoxItem, ISplitButtonItem
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,48 @@
|
|||||||
<UserControl x:Class="HandyControlDemo.UserControl.SplitButtonDemoCtl"
|
<UserControl x:Class="HandyControlDemo.UserControl.SplitButtonDemoCtl"
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl">
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
<userControl:UnderConstruction/>
|
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||||
|
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
|
||||||
|
DataContext="{Binding SplitButtonDemo,Source={StaticResource Locator}}">
|
||||||
|
<hc:TransitioningContentControl>
|
||||||
|
<StackPanel Margin="32" VerticalAlignment="Center">
|
||||||
|
<hc:SplitButton Margin="0,0,0,10" Content="{x:Static langs:Lang.Default}" Command="{Binding SelectCmd}" CommandParameter="Command0">
|
||||||
|
<hc:SplitButton.DropDownContent>
|
||||||
|
<StackPanel>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command1"/>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command2"/>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command3"/>
|
||||||
|
</StackPanel>
|
||||||
|
</hc:SplitButton.DropDownContent>
|
||||||
|
</hc:SplitButton>
|
||||||
|
<hc:SplitButton Style="{StaticResource SplitButtonPrimary}" Margin="0,0,0,10" Content="{x:Static langs:Lang.Default}" Command="{Binding SelectCmd}" CommandParameter="Command0">
|
||||||
|
<hc:SplitButton.DropDownContent>
|
||||||
|
<StackPanel>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command1"/>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command2"/>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command3"/>
|
||||||
|
</StackPanel>
|
||||||
|
</hc:SplitButton.DropDownContent>
|
||||||
|
</hc:SplitButton>
|
||||||
|
<hc:SplitButton Margin="0,0,0,10" Content="{x:Static langs:Lang.Default}" HitMode="Hover">
|
||||||
|
<hc:SplitButton.DropDownContent>
|
||||||
|
<StackPanel>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command1"/>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command2"/>
|
||||||
|
<hc:SplitButtonItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command3"/>
|
||||||
|
</StackPanel>
|
||||||
|
</hc:SplitButton.DropDownContent>
|
||||||
|
</hc:SplitButton>
|
||||||
|
<hc:SplitButton Margin="0,0,0,10" Content="{x:Static langs:Lang.Default}" HitMode="Hover">
|
||||||
|
<hc:SplitButton.DropDownContent>
|
||||||
|
<StackPanel>
|
||||||
|
<userControl:CustomSplitButtonItem Content="{x:Static langs:Lang.Title}"/>
|
||||||
|
<userControl:CustomSplitButtonItem Content="{x:Static langs:Lang.Title}"/>
|
||||||
|
<userControl:CustomSplitButtonItem Content="{x:Static langs:Lang.Title}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</hc:SplitButton.DropDownContent>
|
||||||
|
</hc:SplitButton>
|
||||||
|
</StackPanel>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,4 +1,6 @@
|
|||||||
namespace HandyControlDemo.UserControl
|
using System.Windows;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.UserControl
|
||||||
{
|
{
|
||||||
public partial class SplitButtonDemoCtl
|
public partial class SplitButtonDemoCtl
|
||||||
{
|
{
|
||||||
@@ -6,5 +8,10 @@
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
MessageBox.Show("123");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
using System;
|
||||||
|
using GalaSoft.MvvmLight;
|
||||||
|
using HandyControl.Controls;
|
||||||
|
#if netle40
|
||||||
|
using GalaSoft.MvvmLight.Command;
|
||||||
|
#else
|
||||||
|
using GalaSoft.MvvmLight.CommandWpf;
|
||||||
|
# endif
|
||||||
|
|
||||||
|
namespace HandyControlDemo.ViewModel
|
||||||
|
{
|
||||||
|
public class SplitButtonDemoViewModel : ViewModelBase
|
||||||
|
{
|
||||||
|
public RelayCommand<string> SelectCmd => new Lazy<RelayCommand<string>>(() =>
|
||||||
|
new RelayCommand<string>(str => Growl.Info(str))).Value;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -39,6 +39,7 @@ namespace HandyControlDemo.ViewModel
|
|||||||
SimpleIoc.Default.Register<CardDemoViewModel>();
|
SimpleIoc.Default.Register<CardDemoViewModel>();
|
||||||
SimpleIoc.Default.Register<SpriteDemoViewModel>();
|
SimpleIoc.Default.Register<SpriteDemoViewModel>();
|
||||||
SimpleIoc.Default.Register<NotificationDemoViewModel>();
|
SimpleIoc.Default.Register<NotificationDemoViewModel>();
|
||||||
|
SimpleIoc.Default.Register<SplitButtonDemoViewModel>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||||
@@ -94,6 +95,8 @@ namespace HandyControlDemo.ViewModel
|
|||||||
|
|
||||||
public NotificationDemoViewModel NotificationDemo => ServiceLocator.Current.GetInstance<NotificationDemoViewModel>();
|
public NotificationDemoViewModel NotificationDemo => ServiceLocator.Current.GetInstance<NotificationDemoViewModel>();
|
||||||
|
|
||||||
|
public SplitButtonDemoViewModel SplitButtonDemo => ServiceLocator.Current.GetInstance<SplitButtonDemoViewModel>();
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
namespace HandyControl.Controls
|
||||||
|
{
|
||||||
|
public interface ISplitButtonItem
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,11 +1,19 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Controls.Primitives;
|
||||||
|
using System.Windows.Input;
|
||||||
|
using HandyControl.Data;
|
||||||
using HandyControl.Data.Enum;
|
using HandyControl.Data.Enum;
|
||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
{
|
{
|
||||||
public class SplitButton : ItemsControl
|
[TemplatePart(Name = ElementArrow, Type = typeof(ToggleButton))]
|
||||||
|
public class SplitButton : ButtonBase
|
||||||
{
|
{
|
||||||
|
private const string ElementArrow = "PART_Arrow";
|
||||||
|
|
||||||
|
private ToggleButton _toggleArrow;
|
||||||
|
|
||||||
public static readonly DependencyProperty HitModeProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty HitModeProperty = DependencyProperty.Register(
|
||||||
"HitMode", typeof(MouseHitMode), typeof(SplitButton), new PropertyMetadata(default(MouseHitMode)));
|
"HitMode", typeof(MouseHitMode), typeof(SplitButton), new PropertyMetadata(default(MouseHitMode)));
|
||||||
|
|
||||||
@@ -15,24 +23,6 @@ namespace HandyControl.Controls
|
|||||||
set => SetValue(HitModeProperty, value);
|
set => SetValue(HitModeProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty ContentProperty = DependencyProperty.Register(
|
|
||||||
"Content", typeof(object), typeof(SplitButton), new PropertyMetadata(default(object)));
|
|
||||||
|
|
||||||
public object Content
|
|
||||||
{
|
|
||||||
get => GetValue(ContentProperty);
|
|
||||||
set => SetValue(ContentProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static readonly DependencyProperty ContentTemplateProperty = DependencyProperty.Register(
|
|
||||||
"ContentTemplate", typeof(DataTemplate), typeof(SplitButton), new PropertyMetadata(default(DataTemplate)));
|
|
||||||
|
|
||||||
public DataTemplate ContentTemplate
|
|
||||||
{
|
|
||||||
get => (DataTemplate) GetValue(ContentTemplateProperty);
|
|
||||||
set => SetValue(ContentTemplateProperty, value);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static readonly DependencyProperty MaxDropDownHeightProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty MaxDropDownHeightProperty = DependencyProperty.Register(
|
||||||
"MaxDropDownHeight", typeof(double), typeof(SplitButton), new PropertyMetadata(SystemParameters.PrimaryScreenHeight / 3.0));
|
"MaxDropDownHeight", typeof(double), typeof(SplitButton), new PropertyMetadata(SystemParameters.PrimaryScreenHeight / 3.0));
|
||||||
|
|
||||||
@@ -42,8 +32,57 @@ namespace HandyControl.Controls
|
|||||||
set => SetValue(MaxDropDownHeightProperty, value);
|
set => SetValue(MaxDropDownHeightProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is SplitButtonItem;
|
public static readonly DependencyProperty IsDropDownOpenProperty = DependencyProperty.Register(
|
||||||
|
"IsDropDownOpen", typeof(bool), typeof(SplitButton), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||||
|
|
||||||
protected override DependencyObject GetContainerForItemOverride() => new SplitButtonItem();
|
public bool IsDropDownOpen
|
||||||
|
{
|
||||||
|
get => (bool) GetValue(IsDropDownOpenProperty);
|
||||||
|
set => SetValue(IsDropDownOpenProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty DropDownContentProperty = DependencyProperty.Register(
|
||||||
|
"DropDownContent", typeof(object), typeof(SplitButton), new PropertyMetadata(default(object)));
|
||||||
|
|
||||||
|
public object DropDownContent
|
||||||
|
{
|
||||||
|
get => GetValue(DropDownContentProperty);
|
||||||
|
set => SetValue(DropDownContentProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public SplitButton()
|
||||||
|
{
|
||||||
|
AddHandler(MenuItem.ClickEvent, new RoutedEventHandler(ItemsOnClick));
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void OnApplyTemplate()
|
||||||
|
{
|
||||||
|
base.OnApplyTemplate();
|
||||||
|
|
||||||
|
_toggleArrow = GetTemplateChild(ElementArrow) as ToggleButton;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ItemsOnClick(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (e.OriginalSource is ISplitButtonItem)
|
||||||
|
{
|
||||||
|
SetCurrentValue(IsDropDownOpenProperty, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||||
|
{
|
||||||
|
base.OnPreviewMouseLeftButtonDown(e);
|
||||||
|
|
||||||
|
if (HitMode == MouseHitMode.Hover)
|
||||||
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
else if (_toggleArrow != null && _toggleArrow.IsMouseOver)
|
||||||
|
{
|
||||||
|
SetCurrentValue(IsDropDownOpenProperty, _toggleArrow.IsChecked != true);
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
{
|
{
|
||||||
public class SplitButtonItem : MenuItem
|
public class SplitButtonItem : MenuItem, ISplitButtonItem
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\RectangleAttach.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\RectangleAttach.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\TextBlockAttach.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\TextBlockAttach.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Block\FloatingBlock.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Block\FloatingBlock.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Button\SplitButton\ISplitButtonItem.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Button\SplitButton\SplitButton.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Button\SplitButton\SplitButton.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Button\SplitButton\SplitButtonItem.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Button\SplitButton\SplitButtonItem.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Growl\GrowlWindow.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Growl\GrowlWindow.cs" />
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -183,13 +182,13 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
<Style x:Key="DatePickerExtendBaseStyle" BasedOn="{StaticResource DatePickerBaseStyle}" TargetType="DatePicker">
|
<Style x:Key="DatePickerExtendBaseStyle" BasedOn="{StaticResource DatePickerBaseStyle}" TargetType="DatePicker">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="Template" Value="{StaticResource DatePickerExtendTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource DatePickerExtendTopTemplate}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource DatePickerExtendLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource DatePickerExtendLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -351,7 +350,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource DatePickerPlusLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource DatePickerPlusLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -162,13 +161,13 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
<Style x:Key="DateTimePickerExtendBaseStyle" BasedOn="{StaticResource DateTimePickerBaseStyle}" TargetType="controls:DateTimePicker">
|
<Style x:Key="DateTimePickerExtendBaseStyle" BasedOn="{StaticResource DateTimePickerBaseStyle}" TargetType="controls:DateTimePicker">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="Template" Value="{StaticResource DateTimePickerExtendTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource DateTimePickerExtendTopTemplate}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource DateTimePickerExtendLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource DateTimePickerExtendLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -330,7 +329,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource DateTimePickerPlusLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource DateTimePickerPlusLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity"
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="../../Basic/Geometries.xaml"/>
|
<ResourceDictionary Source="../../Basic/Geometries.xaml"/>
|
||||||
@@ -131,12 +130,12 @@
|
|||||||
<Style x:Key="NumericUpDownExtendBaseStyle" BasedOn="{StaticResource NumericUpDownBaseStyle}" TargetType="controls:NumericUpDown">
|
<Style x:Key="NumericUpDownExtendBaseStyle" BasedOn="{StaticResource NumericUpDownBaseStyle}" TargetType="controls:NumericUpDown">
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="Template" Value="{StaticResource NumericUpDownExtendTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource NumericUpDownExtendTopTemplate}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource NumericUpDownExtendLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource NumericUpDownExtendLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -270,7 +269,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource NumericUpDownPlusLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource NumericUpDownPlusLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -115,7 +114,7 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
<Style x:Key="PasswordBoxExtendBaseStyle" BasedOn="{StaticResource PasswordBoxBaseStyle}" TargetType="PasswordBox">
|
<Style x:Key="PasswordBoxExtendBaseStyle" BasedOn="{StaticResource PasswordBoxBaseStyle}" TargetType="PasswordBox">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
<Setter Property="controls:PasswordBoxAttach.IsMonitoring" Value="True"/>
|
<Setter Property="controls:PasswordBoxAttach.IsMonitoring" Value="True"/>
|
||||||
@@ -123,7 +122,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource PasswordBoxExtendLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource PasswordBoxExtendLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -291,7 +290,7 @@
|
|||||||
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
|
||||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
|
||||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="Padding" Value="{StaticResource DefaultInputPadding}"/>
|
<Setter Property="Padding" Value="{StaticResource DefaultInputPadding}"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
@@ -301,7 +300,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource PasswordBoxPlusLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource PasswordBoxPlusLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="ToggleButtonBaseStyle.xaml"/>
|
<ResourceDictionary Source="ToggleButtonBaseStyle.xaml"/>
|
||||||
@@ -32,7 +31,7 @@
|
|||||||
<ControlTemplate TargetType="controls:ProgressButton">
|
<ControlTemplate TargetType="controls:ProgressButton">
|
||||||
<Border x:Name="Chrome" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
<Border x:Name="Chrome" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||||
<controls:SimplePanel>
|
<controls:SimplePanel>
|
||||||
<ProgressBar x:Name="ProgressBar" Height="{x:Static system:Double.NaN}" Value="{TemplateBinding Progress}" Maximum="100" Visibility="Collapsed" Style="{TemplateBinding ProgressStyle}"/>
|
<ProgressBar x:Name="ProgressBar" Height="Auto" Value="{TemplateBinding Progress}" Maximum="100" Visibility="Collapsed" Style="{TemplateBinding ProgressStyle}"/>
|
||||||
<ContentPresenter Name="UnCheckedElement" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
<ContentPresenter Name="UnCheckedElement" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||||
<ContentPresenter Name="CheckedElement" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Visibility="Collapsed" Content="{Binding Path=(controls:StatusSwitchElement.CheckedElement),RelativeSource={RelativeSource TemplatedParent}}"/>
|
<ContentPresenter Name="CheckedElement" Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Visibility="Collapsed" Content="{Binding Path=(controls:StatusSwitchElement.CheckedElement),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
</controls:SimplePanel>
|
</controls:SimplePanel>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -109,13 +108,13 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
<Style x:Key="SearchBarExtendBaseStyle" BasedOn="{StaticResource SearchBarBaseStyle}" TargetType="controls:SearchBar">
|
<Style x:Key="SearchBarExtendBaseStyle" BasedOn="{StaticResource SearchBarBaseStyle}" TargetType="controls:SearchBar">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="Template" Value="{StaticResource SearchBarExtendTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource SearchBarExtendTopTemplate}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource SearchBarExtendLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource SearchBarExtendLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -249,7 +248,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource SearchBarPlusLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource SearchBarPlusLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -3,12 +3,92 @@
|
|||||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="ButtonBaseBaseStyle.xaml"/>
|
<ResourceDictionary Source="MenuBaseStyle.xaml"/>
|
||||||
|
<ResourceDictionary Source="../ToggleButton.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<Style x:Key="SplitButtonBaseStyle" BasedOn="{StaticResource ButtonBaseBaseStyle}" TargetType="controls:SplitButton">
|
<Style BasedOn="{StaticResource MenuItemBaseStyle}" TargetType="controls:SplitButtonItem"/>
|
||||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
|
||||||
|
|
||||||
|
<Style x:Key="SplitButtonBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="controls:SplitButton">
|
||||||
|
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||||
|
<Setter Property="Padding" Value="{StaticResource DefaultControlPadding}"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="0"/>
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="{StaticResource DefaultCornerRadius}"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="controls:SplitButton">
|
||||||
|
<controls:SimplePanel x:Name="templateRoot">
|
||||||
|
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
|
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
|
||||||
|
<Path x:Name="PathMain" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||||
|
<ContentPresenter x:Name="ContentPresenterMain" RecognizesAccessKey="True" VerticalAlignment="Center" Margin="6,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||||
|
</StackPanel>
|
||||||
|
<ToggleButton x:Name="PART_Arrow" Foreground="{TemplateBinding Foreground}" IsChecked="{TemplateBinding IsDropDownOpen}" Width="22" Height="Auto" Padding="0,10,8,10" HorizontalContentAlignment="Left" Grid.Column="1" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.GeometrySelected="{StaticResource UpGeometry}" controls:IconElement.Geometry="{StaticResource DownGeometry}"/>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
<Popup x:Name="PART_Popup" AllowsTransparency="true" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{StaticResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
|
||||||
|
<Border CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="dropDownBorder" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" Background="{DynamicResource RegionBrush}">
|
||||||
|
<ScrollViewer Margin="0,4" x:Name="DropDownScrollViewer">
|
||||||
|
<controls:SimplePanel RenderOptions.ClearTypeHint="Enabled">
|
||||||
|
<Canvas HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">
|
||||||
|
<Rectangle x:Name="opaqueRect" Fill="{Binding Background, ElementName=dropDownBorder}" Height="{Binding ActualHeight, ElementName=dropDownBorder}" Width="{Binding ActualWidth, ElementName=dropDownBorder}"/>
|
||||||
|
</Canvas>
|
||||||
|
<ContentPresenter ContentSource="DropDownContent"/>
|
||||||
|
</controls:SimplePanel>
|
||||||
|
</ScrollViewer>
|
||||||
|
</Border>
|
||||||
|
</Popup>
|
||||||
|
</controls:SimplePanel>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="Content" Value="{x:Null}">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" TargetName="ContentPresenterMain"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="controls:IconElement.Geometry" Value="{x:Null}">
|
||||||
|
<Setter Property="Visibility" Value="Collapsed" TargetName="PathMain"/>
|
||||||
|
<Setter Property="Margin" Value="0" TargetName="ContentPresenterMain"/>
|
||||||
|
</Trigger>
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="HitMode" Value="Hover"/>
|
||||||
|
<Condition Property="IsMouseOver" Value="True"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
<Setter Property="IsDropDownOpen" Value="True"/>
|
||||||
|
</MultiTrigger>
|
||||||
|
<MultiTrigger>
|
||||||
|
<MultiTrigger.Conditions>
|
||||||
|
<Condition Property="HitMode" Value="Click"/>
|
||||||
|
<Condition Property="IsChecked" Value="True" SourceName="PART_Arrow"/>
|
||||||
|
</MultiTrigger.Conditions>
|
||||||
|
<Setter Property="IsDropDownOpen" Value="True"/>
|
||||||
|
</MultiTrigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Opacity" Value=".9"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter Property="Opacity" Value=".6"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Opacity" Value="0.4"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -130,12 +129,12 @@
|
|||||||
<Style x:Key="TextBoxExtendBaseStyle" BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox">
|
<Style x:Key="TextBoxExtendBaseStyle" BasedOn="{StaticResource TextBoxBaseStyle}" TargetType="TextBox">
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
<Setter Property="controls:InfoElement.ContentHeight" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="Template" Value="{StaticResource TextBoxExtendTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource TextBoxExtendTopTemplate}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource TextBoxExtendLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource TextBoxExtendLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -265,7 +264,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource TextBoxPlusLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource TextBoxPlusLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
xmlns:system="clr-namespace:System;assembly=mscorlib"
|
|
||||||
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
@@ -162,13 +161,13 @@
|
|||||||
</ControlTemplate>
|
</ControlTemplate>
|
||||||
|
|
||||||
<Style x:Key="TimePickerExtendBaseStyle" BasedOn="{StaticResource TimePickerBaseStyle}" TargetType="controls:TimePicker">
|
<Style x:Key="TimePickerExtendBaseStyle" BasedOn="{StaticResource TimePickerBaseStyle}" TargetType="controls:TimePicker">
|
||||||
<Setter Property="Height" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Height" Value="Auto"/>
|
||||||
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
<Setter Property="controls:InfoElement.Symbol" Value="●"/>
|
||||||
<Setter Property="Template" Value="{StaticResource TimePickerExtendTopTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource TimePickerExtendTopTemplate}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource TimePickerExtendLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource TimePickerExtendLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -330,7 +329,7 @@
|
|||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
<Trigger Property="controls:InfoElement.TitleAlignment" Value="Left">
|
||||||
<Setter Property="Template" Value="{StaticResource TimePickerPlusLeftTemplate}"/>
|
<Setter Property="Template" Value="{StaticResource TimePickerPlusLeftTemplate}"/>
|
||||||
<Setter Property="Width" Value="{x:Static system:Double.NaN}"/>
|
<Setter Property="Width" Value="Auto"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|||||||
@@ -1,10 +1,42 @@
|
|||||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="Base/SplitButtonBaseStyle.xaml"/>
|
<ResourceDictionary Source="Base/SplitButtonBaseStyle.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource SplitButtonBaseStyle}" TargetType="controls:SplitButton"/>
|
<Style BasedOn="{StaticResource SplitButtonBaseStyle}" TargetType="controls:SplitButton">
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource BorderBrush}"/>
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SplitButtonPrimary" BasedOn="{StaticResource SplitButtonBaseStyle}" TargetType="controls:SplitButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SplitButtonSuccess" BasedOn="{StaticResource SplitButtonBaseStyle}" TargetType="controls:SplitButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SplitButtonInfo" BasedOn="{StaticResource SplitButtonBaseStyle}" TargetType="controls:SplitButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SplitButtonWarning" BasedOn="{StaticResource SplitButtonBaseStyle}" TargetType="controls:SplitButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="SplitButtonDanger" BasedOn="{StaticResource SplitButtonBaseStyle}" TargetType="controls:SplitButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
Reference in new issue
Block a user