Merge pull request #172 from HandyOrg/add-SplitButton

Add split button
This commit is contained in:
NaBian authored and GitHub committed 2019-09-17 00:50:13 +08:00
commit 1cc89b2849
44 files changed
+524 -92

No files matched your search

@@ -0,0 +1,39 @@
<UserControl x:Class="HandyControlDemo.UserControl.SplitButtonDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
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" HorizontalAlignment="Stretch">
<hc:SplitButton.DropDownContent>
<StackPanel>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command1"/>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command2"/>
<MenuItem 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.Primary}" Command="{Binding SelectCmd}" CommandParameter="Command0" HorizontalAlignment="Stretch">
<hc:SplitButton.DropDownContent>
<StackPanel>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command1"/>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command2"/>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command3"/>
</StackPanel>
</hc:SplitButton.DropDownContent>
</hc:SplitButton>
<hc:SplitButton Style="{StaticResource SplitButtonWarning}" Margin="0,0,0,10" Content="{x:Static langs:Lang.Warning}" HitMode="Hover" HorizontalAlignment="Stretch">
<hc:SplitButton.DropDownContent>
<StackPanel>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command1"/>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command2"/>
<MenuItem Header="{x:Static langs:Lang.Title}" Command="{Binding SelectCmd}" CommandParameter="Command3"/>
</StackPanel>
</hc:SplitButton.DropDownContent>
</hc:SplitButton>
</StackPanel>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,17 @@
using System.Windows;
namespace HandyControlDemo.UserControl
{
public partial class SplitButtonDemoCtl
{
public SplitButtonDemoCtl()
{
InitializeComponent();
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
MessageBox.Show("123");
}
}
}
@@ -225,6 +225,11 @@
<Image Source="../../Resources/Img/LeftMainContent/GoToTop_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.SplitButtonDemoCtl}" Content="{x:Static langs:Lang.SplitButton}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/SplitButton_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ButtonGroupDemoCtl}" Content="{x:Static langs:Lang.ButtonGroup}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ButtonGroup_16x.png"/>
@@ -330,7 +335,7 @@
<Image Source="../../Resources/Img/LeftMainContent/TextBlock_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.RunningBlockDemoCtl}" Content="{x:Static langs:Lang.RunningBlock}">
<ListBoxItem Tag="{x:Static data:MessageToken.RunningBlockDemoCtl}" Content="{x:Static langs:Lang.RunningBlock}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/Dynamic_16x.png"/>
</hc:EdgeElement.LeftContent>