add style and demo
This commit is contained in:
1 parent
1b49c516c3
commit
61c5044b6f
25 files changed
+312
-71
No files matched your search
@@ -53,6 +53,16 @@ namespace HandyControlDemo
|
||||
Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml")
|
||||
});
|
||||
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">
|
||||
<DependentUpon>ChatBox.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\CustomSplitButtonItem.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\IFull.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\InteractiveDialog.xaml.cs">
|
||||
<DependentUpon>InteractiveDialog.xaml</DependentUpon>
|
||||
@@ -341,6 +342,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\PaginationDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SearchBarDemoViewModel.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\StepBarDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\TabControlDemoViewModel.cs" />
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<ResourceDictionary 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:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
@@ -98,4 +99,6 @@
|
||||
<Setter Property="Padding" Value="25"/>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource ComboBoxItemBaseStyle}" TargetType="userControl:CustomSplitButtonItem"/>
|
||||
|
||||
</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"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl">
|
||||
<userControl:UnderConstruction/>
|
||||
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">
|
||||
<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>
|
||||
@@ -1,4 +1,6 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
using System.Windows;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class SplitButtonDemoCtl
|
||||
{
|
||||
@@ -6,5 +8,10 @@
|
||||
{
|
||||
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<SpriteDemoViewModel>();
|
||||
SimpleIoc.Default.Register<NotificationDemoViewModel>();
|
||||
SimpleIoc.Default.Register<SplitButtonDemoViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||
@@ -94,6 +95,8 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public NotificationDemoViewModel NotificationDemo => ServiceLocator.Current.GetInstance<NotificationDemoViewModel>();
|
||||
|
||||
public SplitButtonDemoViewModel SplitButtonDemo => ServiceLocator.Current.GetInstance<SplitButtonDemoViewModel>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user