update to v1.3.4

1. add datagrid style
2. improve the numericupdown
3. add checkbox style
4. add listbox demo
5. add treeview demo
6. add border demo
7. remove angle property of iconelement
8. add menu demo
This commit is contained in:
NaBian committed 2018-10-19 14:47:43 +08:00
1 parent 8997e418f7
commit 880a0eefba
89 files changed
+1707 -216

No files matched your search

+9
View File
@@ -4,6 +4,8 @@
xmlns:viewModel="clr-namespace:HandyControlDemo.ViewModel"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:data="clr-namespace:HandyControlDemo.Data"
d1P1:Ignorable="d"
StartupUri="MainWindow.xaml">
<Application.Resources>
@@ -16,6 +18,13 @@
<viewModel:ViewModelLocator x:Key="Locator" d:IsDataSource="True"/>
</ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<ObjectDataProvider x:Key="DemoTypes" MethodName="GetValues" ObjectType="sys:Enum">
<ObjectDataProvider.MethodParameters>
<x:Type Type="data:DemoType"></x:Type>
</ObjectDataProvider.MethodParameters>
</ObjectDataProvider>
</ResourceDictionary>
</Application.Resources>
+13
View File
@@ -0,0 +1,13 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.Data
{
public enum DemoType
{
Type1 = 1,
Type2,
Type3,
Type4,
Type5,
Type6
}
}
+14
View File
@@ -30,6 +30,8 @@
public static readonly string NumericUpDownDemoCtl = nameof(NumericUpDownDemoCtl);
public static readonly string WindowDemoCtl = nameof(WindowDemoCtl);
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
@@ -54,6 +56,18 @@
public static readonly string NaiveTabControlDemoCtl = nameof(NaiveTabControlDemoCtl);
public static readonly string DataGridDemoCtl = nameof(DataGridDemoCtl);
public static readonly string CheckBoxDemoCtl = nameof(CheckBoxDemoCtl);
public static readonly string ListBoxDemoCtl = nameof(ListBoxDemoCtl);
public static readonly string MenuDemoCtl = nameof(MenuDemoCtl);
public static readonly string TreeViewDemoCtl = nameof(TreeViewDemoCtl);
public static readonly string BorderDemoCtl = nameof(BorderDemoCtl);
public static readonly string LoadShowContent = nameof(LoadShowContent);
}
}
+9 -2
View File
@@ -17,7 +17,8 @@ var controlList = new List<string>
"ClockDemoCtl",
"TimePickerDemoCtl",
"CirclePanelDemoCtl",
"NumericUpDownDemoCtl"
"NumericUpDownDemoCtl",
"WindowDemoCtl"
};
var styleList = new List<string>
{
@@ -32,7 +33,13 @@ var styleList = new List<string>
"TextBlockDemoCtl",
"ComboBoxDemoCtl",
"PasswordBoxDemoCtl",
"NaiveTabControlDemoCtl"
"NaiveTabControlDemoCtl",
"DataGridDemoCtl",
"CheckBoxDemoCtl",
"ListBoxDemoCtl",
"MenuDemoCtl",
"TreeViewDemoCtl",
"BorderDemoCtl"
};
#>
namespace HandyControlDemo.Data
@@ -0,0 +1,20 @@
using System.Collections.Generic;
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.Data
{
public class DemoDataModel
{
public int Index { get; set; }
public string Name { get; set; }
public bool IsSelected { get; set; }
public string Remark { get; set; }
public DemoType Type { get; set; }
public List<DemoDataModel> DataList { get; set; }
}
}
+85
View File
@@ -62,11 +62,13 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
<Compile Include="Data\Enum\DemoType.cs" />
<Compile Include="Data\MessageToken.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>MessageToken.tt</DependentUpon>
</Compile>
<Compile Include="Data\Model\DemoDataModel.cs" />
<Compile Include="Properties\Langs\Lang.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
@@ -115,18 +117,30 @@
<Compile Include="UserControl\Controls\TimePickerDemoCtl.xaml.cs">
<DependentUpon>TimePickerDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Controls\WindowDemoCtl.xaml.cs">
<DependentUpon>WindowDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Main\NoUserContent.xaml.cs">
<DependentUpon>NoUserContent.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\BorderDemoCtl.xaml.cs">
<DependentUpon>BorderDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ButtonDemoCtl.xaml.cs">
<DependentUpon>ButtonDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\CalendarDemoCtl.xaml.cs">
<DependentUpon>CalendarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\CheckBoxDemoCtl.xaml.cs">
<DependentUpon>CheckBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ComboBoxDemoCtl.xaml.cs">
<DependentUpon>ComboBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\DataGridDemoCtl.xaml.cs">
<DependentUpon>DataGridDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\DatePickerDemoCtl.xaml.cs">
<DependentUpon>DatePickerDemoCtl.xaml</DependentUpon>
</Compile>
@@ -145,6 +159,12 @@
<Compile Include="UserControl\Controls\TimeBarDemoCtl.xaml.cs">
<DependentUpon>TimeBarDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\ListBoxDemoCtl.xaml.cs">
<DependentUpon>ListBoxDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\MenuDemoCtl.xaml.cs">
<DependentUpon>MenuDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\NaiveTabControlDemoCtl.xaml.cs">
<DependentUpon>NaiveTabControlDemoCtl.xaml</DependentUpon>
</Compile>
@@ -166,6 +186,9 @@
<Compile Include="UserControl\Styles\ToggleButtonDemoCtl.xaml.cs">
<DependentUpon>ToggleButtonDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="UserControl\Styles\TreeViewDemoCtl.xaml.cs">
<DependentUpon>TreeViewDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="ViewModel\ComboBoxDemoViewModel.cs" />
<Compile Include="ViewModel\GrowlDemoViewModel.cs" />
<Compile Include="ViewModel\ImageBrowserDemoViewModel.cs" />
@@ -263,10 +286,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Controls\WindowDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Main\NoUserContent.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\BorderDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\ButtonDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -275,10 +306,18 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\CheckBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\ComboBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\DataGridDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\DatePickerDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -303,6 +342,14 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\ListBoxDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\MenuDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\NaiveTabControlDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -331,6 +378,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="UserControl\Styles\TreeViewDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -359,6 +410,39 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput>
</Content>
<Resource Include="Resources\Img\BorderElement_16x.png" />
<Resource Include="Resources\Img\ScrollBox_16x.png" />
<Resource Include="Resources\Img\ContextMenu_16x.png" />
<Resource Include="Resources\Img\WindowsForm_16x.png" />
<Resource Include="Resources\Img\TreeView_16x.png" />
<Resource Include="Resources\Img\ListBox_16x.png" />
<Resource Include="Resources\Img\CheckBox_16x.png" />
<Resource Include="Resources\Img\Path_16x.png" />
<Resource Include="Resources\Img\Paginator_16x.png" />
<Resource Include="Resources\Img\Timeline_16x.png" />
<Resource Include="Resources\Img\SplitterControl_16x.png" />
<Resource Include="Resources\Img\Carousel_16x.png" />
<Resource Include="Resources\Img\ColorPalette_16x.png" />
<Resource Include="Resources\Img\ImageBrowser_16x.png" />
<Resource Include="Resources\Img\Loading_Blue_16x.png" />
<Resource Include="Resources\Img\Message_16x.png" />
<Resource Include="Resources\Img\Flow_16x.png" />
<Resource Include="Resources\Img\TimePicker_16x.png" />
<Resource Include="Resources\Img\Time_color_16x.png" />
<Resource Include="Resources\Img\ShapeArcRing_16x.png" />
<Resource Include="Resources\Img\NumericListBox_16x.png" />
<Resource Include="Resources\Img\Toggle_16x.png" />
<Resource Include="Resources\Img\DataGrid_16x.png" />
<Resource Include="Resources\Img\TabPage_16x.png" />
<Resource Include="Resources\Img\DatePicker_16x.png" />
<Resource Include="Resources\Img\Calendar_16x.png" />
<Resource Include="Resources\Img\ProgressBar_16x.png" />
<Resource Include="Resources\Img\Expander_16x.png" />
<Resource Include="Resources\Img\PasswordBox_16x.png" />
<Resource Include="Resources\Img\TextBox_16x.png" />
<Resource Include="Resources\Img\ComboBox_16x.png" />
<Resource Include="Resources\Img\TextBlock_16x.png" />
<Resource Include="Resources\Img\ButtonClick_16x.png" />
</ItemGroup>
<ItemGroup>
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
@@ -374,6 +458,7 @@
<EmbeddedResource Include="Properties\Langs\Lang.resx">
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+1
View File
@@ -13,6 +13,7 @@
Style="{StaticResource CustomWindowStyle}"
WindowState="Maximized"
Title="MainWindow"
ResizeMode="CanResizeWithGrip"
Name="MyWindow"
DataContext="{Binding Main,Source={StaticResource Locator}}"
d:DesignHeight="800"
+2 -2
View File
@@ -12,5 +12,5 @@ using System.Windows;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("1.3.3")]
[assembly: AssemblyFileVersion("1.3.3")]
[assembly: AssemblyVersion("1.3.4")]
[assembly: AssemblyFileVersion("1.3.4")]
+117
View File
@@ -78,6 +78,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 边框 的本地化字符串。
/// </summary>
public static string Border1 {
get {
return ResourceManager.GetString("Border1", resourceCulture);
}
}
/// <summary>
/// 查找类似 按钮 的本地化字符串。
/// </summary>
@@ -204,6 +213,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 数据表格 的本地化字符串。
/// </summary>
public static string DataGrid {
get {
return ResourceManager.GetString("DataGrid", resourceCulture);
}
}
/// <summary>
/// 查找类似 日期选择器 的本地化字符串。
/// </summary>
@@ -303,6 +321,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 索引 的本地化字符串。
/// </summary>
public static string Index {
get {
return ResourceManager.GetString("Index", resourceCulture);
}
}
/// <summary>
/// 查找类似 信息 的本地化字符串。
/// </summary>
@@ -312,6 +339,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 列表框 的本地化字符串。
/// </summary>
public static string ListBox {
get {
return ResourceManager.GetString("ListBox", resourceCulture);
}
}
/// <summary>
/// 查找类似 加载条 的本地化字符串。
/// </summary>
@@ -321,6 +357,24 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 菜单 的本地化字符串。
/// </summary>
public static string Menu {
get {
return ResourceManager.GetString("Menu", resourceCulture);
}
}
/// <summary>
/// 查找类似 名称 的本地化字符串。
/// </summary>
public static string Name {
get {
return ResourceManager.GetString("Name", resourceCulture);
}
}
/// <summary>
/// 查找类似 下一步 的本地化字符串。
/// </summary>
@@ -411,6 +465,42 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 备注 的本地化字符串。
/// </summary>
public static string Remark {
get {
return ResourceManager.GetString("Remark", resourceCulture);
}
}
/// <summary>
/// 查找类似 在这里右击 的本地化字符串。
/// </summary>
public static string RightClickHere {
get {
return ResourceManager.GetString("RightClickHere", resourceCulture);
}
}
/// <summary>
/// 查找类似 滚动视图 的本地化字符串。
/// </summary>
public static string ScrollViewer {
get {
return ResourceManager.GetString("ScrollViewer", resourceCulture);
}
}
/// <summary>
/// 查找类似 选中 的本地化字符串。
/// </summary>
public static string Selected {
get {
return ResourceManager.GetString("Selected", resourceCulture);
}
}
/// <summary>
/// 查找类似 步骤条 的本地化字符串。
/// </summary>
@@ -546,6 +636,24 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 树视图 的本地化字符串。
/// </summary>
public static string TreeView {
get {
return ResourceManager.GetString("TreeView", resourceCulture);
}
}
/// <summary>
/// 查找类似 类型 的本地化字符串。
/// </summary>
public static string Type {
get {
return ResourceManager.GetString("Type", resourceCulture);
}
}
/// <summary>
/// 查找类似 上传文件 的本地化字符串。
/// </summary>
@@ -563,5 +671,14 @@ namespace HandyControlDemo.Properties.Langs {
return ResourceManager.GetString("Warning", resourceCulture);
}
}
/// <summary>
/// 查找类似 窗口 的本地化字符串。
/// </summary>
public static string Window {
get {
return ResourceManager.GetString("Window", resourceCulture);
}
}
}
}
@@ -285,4 +285,43 @@
<data name="NumericUpDown" xml:space="preserve">
<value>NumericUpDown</value>
</data>
<data name="DataGrid" xml:space="preserve">
<value>DataGrid</value>
</data>
<data name="Index" xml:space="preserve">
<value>Index</value>
</data>
<data name="Name" xml:space="preserve">
<value>Name</value>
</data>
<data name="Type" xml:space="preserve">
<value>Type</value>
</data>
<data name="Remark" xml:space="preserve">
<value>Remark</value>
</data>
<data name="Selected" xml:space="preserve">
<value>Selected</value>
</data>
<data name="ListBox" xml:space="preserve">
<value>ListBox</value>
</data>
<data name="TreeView" xml:space="preserve">
<value>TreeView</value>
</data>
<data name="Border1" xml:space="preserve">
<value>Border</value>
</data>
<data name="ScrollViewer" xml:space="preserve">
<value>ScrollViewer</value>
</data>
<data name="Window" xml:space="preserve">
<value>Window</value>
</data>
<data name="Menu" xml:space="preserve">
<value>Menu</value>
</data>
<data name="RightClickHere" xml:space="preserve">
<value>Right click here </value>
</data>
</root>
@@ -265,4 +265,43 @@
<data name="NumericUpDown" xml:space="preserve">
<value>数值选择控件</value>
</data>
<data name="DataGrid" xml:space="preserve">
<value>数据表格</value>
</data>
<data name="Index" xml:space="preserve">
<value>索引</value>
</data>
<data name="Name" xml:space="preserve">
<value>名称</value>
</data>
<data name="Type" xml:space="preserve">
<value>类型</value>
</data>
<data name="Remark" xml:space="preserve">
<value>备注</value>
</data>
<data name="Selected" xml:space="preserve">
<value>选中</value>
</data>
<data name="ListBox" xml:space="preserve">
<value>列表框</value>
</data>
<data name="TreeView" xml:space="preserve">
<value>树视图</value>
</data>
<data name="Border1" xml:space="preserve">
<value>边框</value>
</data>
<data name="ScrollViewer" xml:space="preserve">
<value>滚动视图</value>
</data>
<data name="Window" xml:space="preserve">
<value>窗口</value>
</data>
<data name="Menu" xml:space="preserve">
<value>菜单</value>
</data>
<data name="RightClickHere" xml:space="preserve">
<value>在这里右击</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 624 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 313 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 263 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 401 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 704 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 196 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 174 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 434 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 199 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 566 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 448 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 143 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 B

@@ -1,5 +1,6 @@
<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;assembly=HandyControl">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
@@ -15,29 +16,26 @@
<Path VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
</Trigger>
<Trigger Property="IsSelected" Value="true">
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="true"/>
<Condition Property="Selector.IsSelectionActive" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}}"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="controls:EdgeElement.ShowEdgeContent" Value="true">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
<StackPanel Orientation="Horizontal">
<ContentControl Width="16" Height="16" Content="{Binding Path=(controls:EdgeElement.LeftContent),RelativeSource={RelativeSource TemplatedParent}}"/>
<ContentPresenter Margin="6,0,0,0" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
<Path VerticalAlignment="Center" Data="{StaticResource NewGeometry}" Stretch="Uniform" Margin="10,0,0,0" Width="30" Height="14" Fill="{DynamicResource DangerBrush}"/>
</StackPanel>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
@@ -2,10 +2,18 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="White">
<controls:TransitioningContentControl>
<StackPanel Margin="32">
<controls:NumericUpDown x:Name="NumericUpDown" Width="240"/>
<controls:NumericUpDown x:Name="NumericUpDown"/>
<controls:NumericUpDown Margin="0,16,0,0" IsEnabled="False"/>
<controls:NumericUpDown controls:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr1}" Margin="0,32,0,0" Style="{StaticResource NumericUpDownExtend}"/>
<controls:NumericUpDown controls:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" controls:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr1}" Margin="0,16,0,0" controls:InfoElement.Necessary="True" Style="{StaticResource NumericUpDownExtend}"/>
<controls:NumericUpDown Width="380" controls:InfoElement.TitleWidth="140" controls:InfoElement.TitleAlignment="Left" controls:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr3}" Style="{StaticResource NumericUpDownExtend}" Margin="0,32,0,0"/>
<controls:NumericUpDown Width="380" controls:InfoElement.TitleWidth="140" controls:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" controls:InfoElement.TitleAlignment="Left" controls:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr3}" Style="{StaticResource NumericUpDownExtend}" controls:InfoElement.Necessary="True" Margin="0,16,0,0"/>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,9 @@
<UserControl x:Class="HandyControlDemo.UserControl.WindowDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
Background="White">
<controls:TransitioningContentControl>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,11 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
public partial class WindowDemoCtl
{
public WindowDemoCtl()
{
InitializeComponent();
}
}
}
@@ -15,36 +15,175 @@
</i:Interaction.Triggers>
<TabItem Header="{x:Static langs:Lang.Styles}">
<ListBox BorderThickness="0" SelectionMode="Single">
<ListBoxItem Tag="{x:Static data:MessageToken.ButtonDemoCtl}" Content="{x:Static langs:Lang.Button}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ToggleButtonDemoCtl}" Content="{x:Static langs:Lang.ToggleButton}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.TextBlockDemoCtl}" Content="{x:Static langs:Lang.TextBlock}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.TextBoxDemoCtl}" Content="{x:Static langs:Lang.TextBox}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ComboBoxDemoCtl}" Content="{x:Static langs:Lang.ComboBox}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.PasswordBoxDemoCtl}" Content="{x:Static langs:Lang.PasswordBox}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ExpanderDemoCtl}" Content="{x:Static langs:Lang.Expander}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressBarDemoCtl}" Content="{x:Static langs:Lang.ProgressBar}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.CalendarDemoCtl}" Content="{x:Static langs:Lang.Calendar}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.DatePickerDemoCtl}" Content="{x:Static langs:Lang.DatePicker}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveTabControlDemoCtl}" Content="{x:Static langs:Lang.TabControl}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ButtonDemoCtl}" Content="{x:Static langs:Lang.Button}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ButtonClick_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ToggleButtonDemoCtl}" Content="{x:Static langs:Lang.ToggleButton}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Toggle_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CheckBoxDemoCtl}" Content="{x:Static langs:Lang.CheckBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/CheckBox_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.TextBlockDemoCtl}" Content="{x:Static langs:Lang.TextBlock}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/TextBlock_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.TextBoxDemoCtl}" Content="{x:Static langs:Lang.TextBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/TextBox_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ComboBoxDemoCtl}" Content="{x:Static langs:Lang.ComboBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ComboBox_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.PasswordBoxDemoCtl}" Content="{x:Static langs:Lang.PasswordBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/PasswordBox_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ExpanderDemoCtl}" Content="{x:Static langs:Lang.Expander}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Expander_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressBarDemoCtl}" Content="{x:Static langs:Lang.ProgressBar}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ProgressBar_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CalendarDemoCtl}" Content="{x:Static langs:Lang.Calendar}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Calendar_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.DatePickerDemoCtl}" Content="{x:Static langs:Lang.DatePicker}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/DatePicker_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveTabControlDemoCtl}" Content="{x:Static langs:Lang.TabControl}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/TabPage_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.DataGridDemoCtl}" Content="{x:Static langs:Lang.DataGrid}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/DataGrid_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.TreeViewDemoCtl}" Content="{x:Static langs:Lang.TreeView}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/TreeView_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ListBoxDemoCtl}" Content="{x:Static langs:Lang.ListBox}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ListBox_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.MenuDemoCtl}" Content="{x:Static langs:Lang.Menu}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ContextMenu_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.BorderDemoCtl}" Content="{x:Static langs:Lang.Border1}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/BorderElement_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
</ListBox>
</TabItem>
<TabItem Header="{x:Static langs:Lang.Controls}">
<ListBox BorderThickness="0" SelectionMode="Single">
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.NumericUpDownDemoCtl}" Content="{x:Static langs:Lang.NumericUpDown}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.CirclePanelDemoCtl}" Content="{x:Static langs:Lang.CirclePanel}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ClockDemoCtl}" Content="{x:Static langs:Lang.Clock}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.TimePickerDemoCtl}" Content="{x:Static langs:Lang.TimePicker}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.StepBarDemoCtl}" Content="{x:Static langs:Lang.StepBar}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.GrowlDemoCtl}" Content="{x:Static langs:Lang.Growl}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.LoadingDemoCtl}" Content="{x:Static langs:Lang.Loading}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ImageBrowserDemoCtl}" Content="{x:Static langs:Lang.ImageBrowser}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.ColorPickerDemoCtl}" Content="{x:Static langs:Lang.ColorPicker}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.CarouselDemoCtl}" Content="{x:Static langs:Lang.Carousel}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.CompareSliderDemoCtl}" Content="{x:Static langs:Lang.CompareSlider}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.TimeBarDemoCtl}" Content="{x:Static langs:Lang.TimeBar}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.PaginationDemoCtl}" Content="{x:Static langs:Lang.Pagination}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.AnimationPathDemoCtl}" Content="{x:Static langs:Lang.AnimationPath}"/>
<ListBoxItem Tag="{x:Static data:MessageToken.TabControlDemoCtl}" Content="{x:Static langs:Lang.TabControl}"/>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.NumericUpDownDemoCtl}" Content="{x:Static langs:Lang.NumericUpDown}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/NumericListBox_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CirclePanelDemoCtl}" Content="{x:Static langs:Lang.CirclePanel}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ShapeArcRing_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ClockDemoCtl}" Content="{x:Static langs:Lang.Clock}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Time_color_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.TimePickerDemoCtl}" Content="{x:Static langs:Lang.TimePicker}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/TimePicker_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.StepBarDemoCtl}" Content="{x:Static langs:Lang.StepBar}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Flow_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.GrowlDemoCtl}" Content="{x:Static langs:Lang.Growl}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Message_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.LoadingDemoCtl}" Content="{x:Static langs:Lang.Loading}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Loading_Blue_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ImageBrowserDemoCtl}" Content="{x:Static langs:Lang.ImageBrowser}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ImageBrowser_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ColorPickerDemoCtl}" Content="{x:Static langs:Lang.ColorPicker}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/ColorPalette_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CarouselDemoCtl}" Content="{x:Static langs:Lang.Carousel}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Carousel_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CompareSliderDemoCtl}" Content="{x:Static langs:Lang.CompareSlider}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/SplitterControl_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.TimeBarDemoCtl}" Content="{x:Static langs:Lang.TimeBar}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Timeline_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.PaginationDemoCtl}" Content="{x:Static langs:Lang.Pagination}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Paginator_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.AnimationPathDemoCtl}" Content="{x:Static langs:Lang.AnimationPath}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/Path_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.TabControlDemoCtl}" Content="{x:Static langs:Lang.TabControl}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/TabPage_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem IsEnabled="False" Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
<controls:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/WindowsForm_16x.png" Stretch="Uniform"/>
</controls:EdgeElement.LeftContent>
</ListBoxItem>
</ListBox>
</TabItem>
</TabControl>
@@ -3,7 +3,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:interactivity="clr-namespace:HandyControl.Interactivity;assembly=HandyControl"
Orientation="Horizontal">
<Button WindowChrome.IsHitTestVisibleInChrome="True" Width="28" Height="28" Style="{StaticResource ButtonCustom}">
<Button WindowChrome.IsHitTestVisibleInChrome="True" Margin="4,0,0,0" Width="28" Height="28" Style="{StaticResource ButtonCustom}">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="Click">
<interactivity:InvokeCommandAction Command="{x:Static SystemCommands.ShowSystemMenuCommand}" />
@@ -0,0 +1,41 @@
<UserControl x:Class="HandyControlDemo.UserControl.BorderDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="White">
<controls:TransitioningContentControl>
<UniformGrid Margin="32,32,0,0" Columns="3" Rows="2">
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32">
<Border Background="{StaticResource PrimaryBrush}">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
</Border>
</Border>
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow1}">
<Border Background="{StaticResource InfoBrush}">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
</Border>
</Border>
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow2}">
<Border Background="{StaticResource WarningBrush}">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
</Border>
</Border>
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow3}">
<Border Background="{StaticResource DangerBrush}">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
</Border>
</Border>
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow4}">
<Border Background="{StaticResource AccentBrush}">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="White"/>
</Border>
</Border>
<Border Style="{StaticResource BorderRegionStyle}" Width="200" Height="200" Margin="0,0,32,32" Effect="{StaticResource EffectShadow5}">
<Border Background="{StaticResource BorderBrush}">
<TextBlock Text="{x:Static langs:Lang.ContentDemoStr}" VerticalAlignment="Center" HorizontalAlignment="Center"/>
</Border>
</Border>
</UniformGrid>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,11 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
public partial class BorderDemoCtl
{
public BorderDemoCtl()
{
InitializeComponent();
}
}
}
@@ -40,9 +40,9 @@
</WrapPanel>
<WrapPanel ItemWidth="160" ItemHeight="130">
<StackPanel>
<Button Width="50" Padding="16,8" Margin="5" controls:IconElement.Angle="45" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"/>
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" controls:IconElement.Angle="45" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="Default(DeleteGeometry)Rotate 45°"/>
<Button Width="50" Padding="16,8" Margin="5" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"/>
<Button Width="50" Padding="16,8" IsEnabled="False" Margin="5" controls:IconElement.Geometry="{StaticResource DeleteGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="Default(DeleteGeometry)"/>
</StackPanel>
<StackPanel>
<Button Content="{x:Static langs:Lang.Clock}" Margin="5" Style="{StaticResource ButtonPrimary}" controls:IconElement.Geometry="{StaticResource ClockGeometry}"/>
@@ -0,0 +1,18 @@
<UserControl x:Class="HandyControlDemo.UserControl.CheckBoxDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="White"
Width="400">
<controls:TransitioningContentControl>
<StackPanel Margin="32" HorizontalAlignment="Center">
<CheckBox VerticalAlignment="Center" Content="{x:Static langs:Lang.Selected}" IsChecked="True"/>
<CheckBox Margin="0,16,0,0" VerticalAlignment="Center" Content="{x:Static langs:Lang.Selected}" IsChecked="True" IsEnabled="False"/>
<CheckBox Margin="0,16,0,0" VerticalAlignment="Center" Content="{x:Static langs:Lang.Selected}"/>
<CheckBox Margin="0,16,0,0" VerticalAlignment="Center" Content="{x:Static langs:Lang.Selected}" IsEnabled="False"/>
<CheckBox Margin="0,16,0,0" VerticalAlignment="Center" Content="{x:Static langs:Lang.Selected}" IsChecked="{x:Null}"/>
<CheckBox Margin="0,16,0,0" VerticalAlignment="Center" Content="{x:Static langs:Lang.Selected}" IsChecked="{x:Null}" IsEnabled="False"/>
</StackPanel>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,11 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
public partial class CheckBoxDemoCtl
{
public CheckBoxDemoCtl()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,24 @@
<UserControl x:Class="HandyControlDemo.UserControl.DataGridDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="White"
MaxWidth="800"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
<controls:TransitioningContentControl>
<DataGrid HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}">
<DataGrid.RowHeaderTemplate>
<DataTemplate>
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource FindAncestor,AncestorType=DataGridRow}}"/>
</DataTemplate>
</DataGrid.RowHeaderTemplate>
<DataGrid.Columns>
<DataGridTextColumn IsReadOnly="True" Width="1*" Binding="{Binding Index}" Header="{x:Static langs:Lang.Index}"/>
<DataGridTextColumn Width="1*" Binding="{Binding Name}" Header="{x:Static langs:Lang.Name}"/>
<DataGridCheckBoxColumn Width="1*" Binding="{Binding IsSelected}" Header="{x:Static langs:Lang.Selected}"/>
<DataGridComboBoxColumn ItemsSource="{Binding Source={StaticResource DemoTypes}}" Width="1*" SelectedValueBinding="{Binding Type}" Header="{x:Static langs:Lang.Type}"/>
<DataGridTextColumn Width="1*" Binding="{Binding Remark}" Header="{x:Static langs:Lang.Remark}"/>
</DataGrid.Columns>
</DataGrid>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,11 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
public partial class DataGridDemoCtl
{
public DataGridDemoCtl()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,15 @@
<UserControl x:Class="HandyControlDemo.UserControl.ListBoxDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
Background="White">
<controls:TransitioningContentControl>
<ListBox Width="200" Margin="32" ItemsSource="{Binding DataList}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,11 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
public partial class ListBoxDemoCtl
{
public ListBoxDemoCtl()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,24 @@
<UserControl x:Class="HandyControlDemo.UserControl.MenuDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="White">
<controls:TransitioningContentControl>
<Grid Margin="32">
<TextBlock Text="{x:Static langs:Lang.RightClickHere}" Foreground="{StaticResource BorderBrush}" Style="{StaticResource TextBlockTitle}"/>
<Rectangle Width="200" Height="112" RadiusX="4" RadiusY="4" Stroke="{StaticResource BorderBrush}" StrokeDashArray="2,2"/>
<Border Width="200" Height="112" Background="Transparent">
<Border.ContextMenu>
<ContextMenu ItemsSource="{Binding DataList}">
<ContextMenu.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding DataList}">
<TextBlock Text="{Binding Name}"/>
</HierarchicalDataTemplate>
</ContextMenu.ItemTemplate>
</ContextMenu>
</Border.ContextMenu>
</Border>
</Grid>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,11 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
public partial class MenuDemoCtl
{
public MenuDemoCtl()
{
InitializeComponent();
}
}
}
@@ -6,100 +6,106 @@
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
<controls:TransitioningContentControl>
<controls:ScrollViewer IsEnableInertia="True">
<WrapPanel Margin="32" ItemWidth="160" ItemHeight="130">
<StackPanel>
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Default}" Margin="5"/>
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Default}" Margin="5"/>
</StackPanel>
<StackPanel>
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Primary}" Margin="5" controls:IconElement.Geometry="{StaticResource ClockGeometry}" Style="{StaticResource ToggleButtonPrimary}"/>
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Primary}" Margin="5" Style="{StaticResource ToggleButtonPrimary}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonPrimary"/>
</StackPanel>
<StackPanel>
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Success}" Margin="5" controls:IconElement.Geometry="{StaticResource CalendarGeometry}" Style="{StaticResource ToggleButtonSuccess}"/>
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ToggleButtonSuccess}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSuccess"/>
</StackPanel>
<StackPanel>
<ToggleButton Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"/>
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonInfo"/>
</StackPanel>
<StackPanel>
<ToggleButton Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"/>
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonWarning"/>
</StackPanel>
<StackPanel>
<ToggleButton Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"/>
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonDanger"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIcon"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconPrimary"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconSuccess"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconInfo"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconWarning"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconDanger"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"/>
</StackPanel>
<StackPanel>
<ToggleButton IsChecked="True" Style="{StaticResource ToggleButtonCustom}" controls:StatusSwitchElement.HiddenElement="True">
<controls:StatusSwitchElement.CheckedElement>
<StackPanel Margin="32">
<WrapPanel ItemWidth="160" ItemHeight="130">
<StackPanel>
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Default}" Margin="5"/>
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Default}" Margin="5"/>
</StackPanel>
<StackPanel>
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Primary}" Margin="5" controls:IconElement.Geometry="{StaticResource ClockGeometry}" Style="{StaticResource ToggleButtonPrimary}"/>
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Primary}" Margin="5" Style="{StaticResource ToggleButtonPrimary}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonPrimary"/>
</StackPanel>
<StackPanel>
<ToggleButton IsChecked="True" Content="{x:Static langs:Lang.Success}" Margin="5" controls:IconElement.Geometry="{StaticResource CalendarGeometry}" Style="{StaticResource ToggleButtonSuccess}"/>
<ToggleButton IsEnabled="False" IsChecked="True" Content="{x:Static langs:Lang.Success}" Margin="5" Style="{StaticResource ToggleButtonSuccess}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSuccess"/>
</StackPanel>
<StackPanel>
<ToggleButton Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"/>
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Info}" Margin="5" Style="{StaticResource ToggleButtonInfo}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonInfo"/>
</StackPanel>
<StackPanel>
<ToggleButton Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"/>
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Warning}" Margin="5" Style="{StaticResource ToggleButtonWarning}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonWarning"/>
</StackPanel>
<StackPanel>
<ToggleButton Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"/>
<ToggleButton IsEnabled="False" Content="{x:Static langs:Lang.Danger}" Margin="5" Style="{StaticResource ToggleButtonDanger}"/>
<TextBlock TextAlignment="Center" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonDanger"/>
</StackPanel>
</WrapPanel>
<WrapPanel ItemWidth="160" ItemHeight="130">
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIcon}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIcon"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconPrimary}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconPrimary"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconSuccess}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconSuccess"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconInfo}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconInfo"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconWarning}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconWarning"/>
</StackPanel>
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconDanger}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconDanger"/>
</StackPanel>
</WrapPanel>
<WrapPanel ItemWidth="160" ItemHeight="130">
<StackPanel>
<ToggleButton Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<ToggleButton IsEnabled="False" Margin="5" Style="{StaticResource ToggleButtonIconTransparent}" controls:IconSwitchElement.Geometry="{StaticResource DeleteGeometry}" controls:IconSwitchElement.GeometrySelected="{StaticResource DownGeometry}"/>
<TextBlock TextAlignment="Center" TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonIconTransparent"/>
</StackPanel>
<StackPanel>
<ToggleButton IsChecked="True" Style="{StaticResource ToggleButtonCustom}" controls:StatusSwitchElement.HiddenElement="True">
<controls:StatusSwitchElement.CheckedElement>
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
<Ellipse Width="20" Height="20" Fill="{StaticResource PrimaryBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
</Border>
</controls:StatusSwitchElement.CheckedElement>
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
<Ellipse Width="20" Height="20" Fill="{StaticResource PrimaryBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
<Ellipse Width="20" Height="20" Fill="{StaticResource BorderBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
</Border>
</controls:StatusSwitchElement.CheckedElement>
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
<Ellipse Width="20" Height="20" Fill="{StaticResource BorderBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
</Border>
</ToggleButton>
<ToggleButton IsEnabled="False" IsChecked="True" Style="{StaticResource ToggleButtonCustom}" controls:StatusSwitchElement.HiddenElement="True">
<controls:StatusSwitchElement.CheckedElement>
</ToggleButton>
<ToggleButton IsEnabled="False" IsChecked="True" Style="{StaticResource ToggleButtonCustom}" controls:StatusSwitchElement.HiddenElement="True">
<controls:StatusSwitchElement.CheckedElement>
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
<Ellipse Width="20" Height="20" Fill="{StaticResource PrimaryBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
</Border>
</controls:StatusSwitchElement.CheckedElement>
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
<Ellipse Width="20" Height="20" Fill="{StaticResource PrimaryBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
<Ellipse Width="20" Height="20" Fill="{StaticResource BorderBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
</Border>
</controls:StatusSwitchElement.CheckedElement>
<Border Width="80" Height="30" CornerRadius="4" BorderThickness="1" BorderBrush="{StaticResource BorderBrush}" Margin="5">
<Ellipse Width="20" Height="20" Fill="{StaticResource BorderBrush}" StrokeThickness="1" Stroke="{StaticResource BorderBrush}"/>
</Border>
</ToggleButton>
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonCustom"/>
</StackPanel>
<StackPanel>
<ToggleButton Height="30" IsChecked="True" Margin="5" Style="{StaticResource ToggleButtonSwitch}"/>
<ToggleButton IsEnabled="False" Height="30" IsChecked="True" Margin="5" Style="{StaticResource ToggleButtonSwitch}"/>
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSwitch"/>
</StackPanel>
</WrapPanel>
</ToggleButton>
<TextBlock TextTrimming="CharacterEllipsis" TextWrapping="Wrap" Style="{StaticResource TextBlockDefault}" Text="ToggleButtonCustom"/>
</StackPanel>
<StackPanel>
<ToggleButton Height="30" IsChecked="True" Margin="5" Style="{StaticResource ToggleButtonSwitch}"/>
<ToggleButton IsEnabled="False" Height="30" IsChecked="True" Margin="5" Style="{StaticResource ToggleButtonSwitch}"/>
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSwitch"/>
</StackPanel>
</WrapPanel>
</StackPanel>
</controls:ScrollViewer>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,15 @@
<UserControl x:Class="HandyControlDemo.UserControl.TreeViewDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
Background="White">
<controls:TransitioningContentControl>
<TreeView Width="200" Margin="32" ItemsSource="{Binding DataList}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding DataList}">
<TextBlock Text="{Binding Name}"/>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
</TreeView>
</controls:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,11 @@
// ReSharper disable once CheckNamespace
namespace HandyControlDemo.UserControl
{
public partial class TreeViewDemoCtl
{
public TreeViewDemoCtl()
{
InitializeComponent();
}
}
}
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Windows.Controls;
using GalaSoft.MvvmLight;
using GalaSoft.MvvmLight.CommandWpf;
@@ -22,15 +23,56 @@ namespace HandyControlDemo.ViewModel
/// </summary>
private object _subContent;
/// <summary>
/// 数据列表
/// </summary>
private List<DemoDataModel> _dataList;
#endregion
public MainViewModel()
{
Messenger.Default.Register<object>(this, MessageToken.LoadShowContent, obj => SubContent = obj);
var list = new List<DemoDataModel>();
for (var i = 1; i <= 6; i++)
{
var dataList = new List<DemoDataModel>();
for (int j = 0; j < 3; j++)
{
dataList.Add(new DemoDataModel
{
Index = j,
IsSelected = j % 2 == 0,
Name = $"SubName{j}",
Type = (DemoType)j
});
}
var model = new DemoDataModel
{
Index = i,
IsSelected = i % 2 == 0,
Name = $"Name{i}",
Type = (DemoType)i,
DataList = dataList
};
list.Add(model);
}
DataList = list;
}
#region 属性
/// <summary>
/// 数据列表
/// </summary>
public List<DemoDataModel> DataList
{
get => _dataList;
set => Set(ref _dataList, value);
}
/// <summary>
/// 子内容
/// </summary>
@@ -74,6 +116,7 @@ namespace HandyControlDemo.ViewModel
{
if (item.Tag is string tag)
{
if (item.Content.Equals(ContentTitle)) return;
ContentTitle = item.Content;
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{tag}"), MessageToken.LoadShowContent);
}