Merge branch 'master' into pr/84

This commit is contained in:
NaBian committed 2019-07-23 21:39:23 +08:00
commit e0d3265883
178 files changed
+3147 -1222

No files matched your search

@@ -100,6 +100,14 @@
public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
public static readonly string ButtonGroupDemoCtl = nameof(ButtonGroupDemoCtl);
public static readonly string CardDemoCtl = nameof(CardDemoCtl);
public static readonly string MagnifierDemoCtl = nameof(MagnifierDemoCtl);
public static readonly string ImageBlockDemoCtl = nameof(ImageBlockDemoCtl);
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
@@ -52,7 +52,11 @@ var controlList = new List<string>
"SideMenuDemoCtl",
"GridDemoCtl",
"PoptipDemoCtl",
"RangeSliderDemoCtl"
"RangeSliderDemoCtl",
"ButtonGroupDemoCtl",
"CardDemoCtl",
"MagnifierDemoCtl",
"ImageBlockDemoCtl"
};
var styleList = new List<string>
{
@@ -0,0 +1,11 @@
namespace HandyControlDemo.Data
{
public class CardModel
{
public string Header { get; set; }
public string Content { get; set; }
public string Footer { get; set; }
}
}
@@ -16,6 +16,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Data\AppConfig.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\DemoType.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\GlobalData.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CardModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\ChatInfoModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\AvatarModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CoverViewDemoModel.cs" />
@@ -25,7 +26,7 @@
<SubType>Code</SubType>
<DependentUpon>MainWindow.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Service\DataService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Service\Data\DataService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\String2BrushConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\StringRepeatConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\AssemblyHelper.cs" />
@@ -44,9 +45,21 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialog.xaml.cs">
<DependentUpon>TextDialog.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialogWithTimer.xaml.cs">
<DependentUpon>TextDialogWithTimer.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml.cs">
<DependentUpon>CardDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageBlockDemoCtl.xaml.cs">
<DependentUpon>ImageBlockDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\MagnifierDemoCtl.xaml.cs">
<DependentUpon>MagnifierDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RangeSliderDemoCtl.xaml.cs">
<DependentUpon>RangeSliderDemoCtl.xaml</DependentUpon>
</Compile>
@@ -56,6 +69,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\BadgeDemoCtl.xaml.cs">
<DependentUpon>BadgeDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ButtonGroupDemoCtl.xaml.cs">
<DependentUpon>ButtonGroupDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml.cs">
<DependentUpon>CalendarWithClockDemoCtl.xaml</DependentUpon>
</Compile>
@@ -189,6 +205,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\BlogsView.xaml.cs">
<DependentUpon>BlogsView.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\NoUserContent.xaml.cs">
<DependentUpon>NoUserContent.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\ProjectsView.xaml.cs">
<DependentUpon>ProjectsView.xaml</DependentUpon>
</Compile>
@@ -295,6 +314,7 @@
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Basic\InteractiveDialogViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Common\ComboBoxDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\BadgeDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CardDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\CoverViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\DialogDemoViewModel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\GrowlDemoViewModel.cs" />
@@ -398,10 +418,26 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Basic\TextDialogWithTimer.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CardDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ImageBlockDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\MagnifierDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\RelativePanelDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -414,6 +450,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ButtonGroupDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -594,6 +634,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Main\NoUserContent.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Main\ProjectsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -766,8 +810,6 @@
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<Compile Update="C:\Users\Mahdi\Documents\GitHub\HandyControl\src\Shared\HandyControlDemo_Shared\UserControl\Controls\PoptipDemoCtl.xaml.cs">
<DependentUpon>PoptipDemoCtl.xaml</DependentUpon>
</Compile>
<Folder Include="$(MSBuildThisFileDirectory)Service\Data\" />
</ItemGroup>
</Project>
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="16.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Label="Globals">
<ProjectGuid>c4694269-c9b8-45d5-87f8-d0088c532510</ProjectGuid>
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
@@ -1,28 +1,23 @@
<hc:BlurWindow x:Class="HandyControlDemo.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
xmlns:data="clr-namespace:HandyControlDemo.Data"
mc:Ignorable="d"
BorderThickness="1"
BorderBrush="#262e2f"
NonClientAreaBackground="#262e2f"
OtherButtonHoverBackground="#888580"
CloseButtonForeground="White"
OtherButtonHoverForeground="White"
OtherButtonForeground="White"
Style="{StaticResource WindowBlur}"
Title="MainWindow"
ResizeMode="CanResizeWithGrip"
WindowStartupLocation="CenterScreen"
Name="MyWindow"
DataContext="{Binding Main,Source={StaticResource Locator}}"
hc:Dialog.Token="{x:Static data:MessageToken.MainWindow}"
d:DesignHeight="800"
d:DesignWidth="1400">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
xmlns:data="clr-namespace:HandyControlDemo.Data"
mc:Ignorable="d"
Style="{StaticResource WindowBlur}"
Title="HandyControlDemo"
ShowTitle="False"
ResizeMode="CanResizeWithGrip"
WindowStartupLocation="CenterScreen"
hc:GlobalShortcut.Host="True"
DataContext="{Binding Main,Source={StaticResource Locator}}"
hc:Dialog.Token="{x:Static data:MessageToken.MainWindow}"
d:DesignHeight="800"
d:DesignWidth="1400"
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
<hc:GlobalShortcut.KeyBindings>
<KeyBinding Modifiers="Control+Alt" Key="I" Command="{Binding Main.GlobalShortcutInfoCmd, Source={StaticResource Locator}}"/>
<KeyBinding Modifiers="Control+Alt" Key="E" Command="{Binding Main.GlobalShortcutWarningCmd, Source={StaticResource Locator}}"/>
@@ -2,7 +2,6 @@
using System.ComponentModel;
using GalaSoft.MvvmLight.Messaging;
using HandyControl.Controls;
using HandyControl.Tools;
using HandyControlDemo.Data;
using HandyControlDemo.Tools;
@@ -22,8 +21,6 @@ namespace HandyControlDemo
Messenger.Default.Send<object>(null, MessageToken.ClearLeftSelected);
Messenger.Default.Send(true, MessageToken.FullSwitch);
Messenger.Default.Send(AssemblyHelper.CreateInternalInstance($"UserControl.{MessageToken.OverView}"), MessageToken.LoadShowContent);
GlobalShortcut.Init(this);
}
protected override void OnClosing(CancelEventArgs e)
@@ -13,5 +13,5 @@ using System.Windows;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("2.0.0")]
[assembly: AssemblyVersion("2.1.0")]
#endif
@@ -178,7 +178,16 @@ namespace HandyControlDemo.Properties.Langs {
}
/// <summary>
/// Looks up a localized string similar to 日历.
/// 查找类似 按钮组 的本地化字符串。
/// </summary>
public static string ButtonGroup {
get {
return ResourceManager.GetString("ButtonGroup", resourceCulture);
}
}
/// <summary>
/// 查找类似 日历 的本地化字符串。
/// </summary>
public static string Calendar {
get {
@@ -196,7 +205,16 @@ namespace HandyControlDemo.Properties.Langs {
}
/// <summary>
/// Looks up a localized string similar to 轮播.
/// 查找类似 卡片 的本地化字符串。
/// </summary>
public static string Card {
get {
return ResourceManager.GetString("Card", resourceCulture);
}
}
/// <summary>
/// 查找类似 轮播 的本地化字符串。
/// </summary>
public static string Carousel {
get {
@@ -673,7 +691,16 @@ namespace HandyControlDemo.Properties.Langs {
}
/// <summary>
/// Looks up a localized string similar to 图片浏览器.
/// 查找类似 图片块 的本地化字符串。
/// </summary>
public static string ImageBlock {
get {
return ResourceManager.GetString("ImageBlock", resourceCulture);
}
}
/// <summary>
/// 查找类似 图片浏览器 的本地化字符串。
/// </summary>
public static string ImageBrowser {
get {
@@ -754,7 +781,16 @@ namespace HandyControlDemo.Properties.Langs {
}
/// <summary>
/// Looks up a localized string similar to 菜单.
/// 查找类似 放大镜 的本地化字符串。
/// </summary>
public static string Magnifier {
get {
return ResourceManager.GetString("Magnifier", resourceCulture);
}
}
/// <summary>
/// 查找类似 菜单 的本地化字符串。
/// </summary>
public static string Menu {
get {
@@ -1097,8 +1133,7 @@ namespace HandyControlDemo.Properties.Langs {
}
/// <summary>
/// Looks up a localized string similar to 注册.
/// 查找类似 推荐 的本地化字符串。
/// 查找类似 群友推荐 的本地化字符串。
/// </summary>
public static string Recommendation {
get {
@@ -1368,7 +1403,16 @@ namespace HandyControlDemo.Properties.Langs {
}
/// <summary>
/// Looks up a localized string similar to 时间条.
/// 查找类似 文本对话框,带计时器 的本地化字符串。
/// </summary>
public static string TextDialogWithTimer {
get {
return ResourceManager.GetString("TextDialogWithTimer", resourceCulture);
}
}
/// <summary>
/// 查找类似 时间条 的本地化字符串。
/// </summary>
public static string TimeBar {
get {
@@ -621,4 +621,19 @@
<data name="Off" xml:space="preserve">
<value>Off</value>
</data>
<data name="ButtonGroup" xml:space="preserve">
<value>ButtonGroup</value>
</data>
<data name="Card" xml:space="preserve">
<value>Card</value>
</data>
<data name="TextDialogWithTimer" xml:space="preserve">
<value>TextDialog with timer</value>
</data>
<data name="Magnifier" xml:space="preserve">
<value>Magnifier</value>
</data>
<data name="ImageBlock" xml:space="preserve">
<value>ImageBlock</value>
</data>
</root>
@@ -604,7 +604,7 @@
<value>Poptip</value>
</data>
<data name="Recommendation" xml:space="preserve">
<value>推荐</value>
<value>群友推荐</value>
</data>
<data name="Project" xml:space="preserve">
<value>项目</value>
@@ -621,4 +621,19 @@
<data name="Off" xml:space="preserve">
<value>关</value>
</data>
<data name="ButtonGroup" xml:space="preserve">
<value>按钮组</value>
</data>
<data name="Card" xml:space="preserve">
<value>卡片</value>
</data>
<data name="TextDialogWithTimer" xml:space="preserve">
<value>文本对话框,带计时器</value>
</data>
<data name="Magnifier" xml:space="preserve">
<value>放大镜</value>
</data>
<data name="ImageBlock" xml:space="preserve">
<value>图片块</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 617 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 194 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 336 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

@@ -76,18 +76,7 @@
</Style>
<ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate">
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<hc:Interaction.Behaviors>
<hc:FluidMoveBehavior AppliesTo="Children" Duration="0:0:.2">
<hc:FluidMoveBehavior.EaseX>
<PowerEase/>
</hc:FluidMoveBehavior.EaseX>
<hc:FluidMoveBehavior.EaseY>
<PowerEase/>
</hc:FluidMoveBehavior.EaseY>
</hc:FluidMoveBehavior>
</hc:Interaction.Behaviors>
</WrapPanel>
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"/>
</ItemsPanelTemplate>
<Style x:Key="MessageBoxCustom" TargetType="hc:MessageBox" BasedOn="{StaticResource {x:Type hc:MessageBox}}">
@@ -97,6 +86,7 @@
<Setter Property="OtherButtonHoverForeground" Value="White"/>
<Setter Property="NonClientAreaForeground" Value="White"/>
<Setter Property="CloseButtonForeground" Value="White"/>
<Setter Property="Icon" Value="/HandyControlDemo;component/Resources/Img/icon.ico"/>
</Style>
<Style x:Key="TextBlockFabricIcons" TargetType="TextBlock">
@@ -116,6 +116,18 @@ namespace HandyControlDemo.Service
DisplayName = "吕毅",
AvatarUri = "https://avatars2.githubusercontent.com/u/9959623?s=400&v=4",
Link = "https://blog.walterlv.com/"
},
new AvatarModel
{
DisplayName = "DinoChan",
AvatarUri = "https://avatars1.githubusercontent.com/u/6076257?s=400&v=4",
Link = "https://www.cnblogs.com/dino623/"
},
new AvatarModel
{
DisplayName = "noctwolf",
AvatarUri = "https://avatars3.githubusercontent.com/u/21022467?s=400&v=4",
Link = "https://www.cnblogs.com/noctwolf/"
}
};
}
@@ -145,6 +157,73 @@ namespace HandyControlDemo.Service
};
}
internal List<CardModel> GetCardDataList()
{
return new List<CardModel>
{
new CardModel
{
Header = "Atomic",
Content = "/HandyControlDemo;component/Resources/Img/Album/1.jpg",
Footer = "Stive Morgan"
},
new CardModel
{
Header = "Zinderlong",
Content = "/HandyControlDemo;component/Resources/Img/Album/2.jpg",
Footer = "Zonderling"
},
new CardModel
{
Header = "Busy Doin' Nothin'",
Content = "/HandyControlDemo;component/Resources/Img/Album/3.jpg",
Footer = "Ace Wilder"
},
new CardModel
{
Header = "Wrong",
Content = "/HandyControlDemo;component/Resources/Img/Album/4.jpg",
Footer = "Blaxy Girls"
},
new CardModel
{
Header = "The Lights",
Content = "/HandyControlDemo;component/Resources/Img/Album/5.jpg",
Footer = "Panda Eyes"
},
new CardModel
{
Header = "EA7-50-Cent Disco",
Content = "/HandyControlDemo;component/Resources/Img/Album/6.jpg",
Footer = "еяхат музыка"
},
new CardModel
{
Header = "Monsters",
Content = "/HandyControlDemo;component/Resources/Img/Album/7.jpg",
Footer = "Different Heaven"
},
new CardModel
{
Header = "Gangsta Walk",
Content = "/HandyControlDemo;component/Resources/Img/Album/8.jpg",
Footer = "Illusionize"
},
new CardModel
{
Header = "Won't Back Down",
Content = "/HandyControlDemo;component/Resources/Img/Album/9.jpg",
Footer = "Boehm / Benjamin Francis Leftwich"
},
new CardModel
{
Header = "Katchi",
Content = "/HandyControlDemo;component/Resources/Img/Album/10.jpg",
Footer = "Ofenbach / Nick Waterhouse"
}
};
}
internal List<StepBarDemoModel> GetStepBarDemoDataList()
{
return new List<StepBarDemoModel>
@@ -37,7 +37,7 @@
</Grid.ColumnDefinitions>
<ToggleButton Name="ToggleButtonAudio" hc:BorderElement.CornerRadius="15" Width="30" Height="30" Padding="7" Margin="6" hc:IconSwitchElement.Geometry="{StaticResource AudioGeometry}" hc:IconSwitchElement.GeometrySelected="{StaticResource KeyboardGeometry}" Style="{StaticResource ToggleButtonIcon}"/>
<Button Command="{Binding OpenImageCmd}" Grid.Column="2" Margin="6,0,6,0" hc:BorderElement.CornerRadius="15" Width="30" Height="30" Padding="7" hc:IconElement.Geometry="{StaticResource ImageGeometry}"/>
<TextBox Grid.Column="1" Text="{Binding ChatString,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsChecked,ElementName=ToggleButtonAudio,Converter={StaticResource Boolean2VisibilityReConverter}}">
<TextBox VerticalAlignment="Center" Grid.Column="1" Text="{Binding ChatString,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding IsChecked,ElementName=ToggleButtonAudio,Converter={StaticResource Boolean2VisibilityReConverter}}">
<hc:Interaction.Triggers>
<hc:EventTrigger EventName="KeyDown">
<hc:EventToCommand Command="{Binding SendStringCmd}" PassEventArgsToCommand="True" />
@@ -1,4 +1,4 @@
<Border x:Class="HandyControlDemo.UserControl.Basic.InteractiveDialog"
<Border x:Class="HandyControlDemo.UserControl.InteractiveDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
@@ -1,4 +1,4 @@
namespace HandyControlDemo.UserControl.Basic
namespace HandyControlDemo.UserControl
{
public partial class InteractiveDialog
{
@@ -0,0 +1,18 @@
<Border x:Class="HandyControlDemo.UserControl.TextDialogWithTimer"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns:hc="https://handyorg.github.io/handycontrol"
CornerRadius="10"
Width="400"
Height="247"
DataContext="{Binding InteractiveDialog, Source={StaticResource Locator}}"
Background="{DynamicResource RegionBrush}">
<hc:SimplePanel>
<Viewbox Width="80" Height="80">
<TextBlock TextWrapping="Wrap" Style="{StaticResource TextBlockLargeBold}" Text="{x:Static langs:Lang.PleaseWait}"/>
</Viewbox>
<Button Name="ButtonClose" Width="22" Height="22" Command="{Binding CloseCmd}" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryBrush}" hc:IconElement.Geometry="{StaticResource ErrorGeometry}" Padding="0" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,4,4,0"/>
<hc:CircleProgressBar Name="ProgressBarTimer" ShowText="False" Width="120" Height="120"/>
</hc:SimplePanel>
</Border>
@@ -0,0 +1,24 @@
using System;
using System.Windows.Controls.Primitives;
using HandyControl.Tools;
namespace HandyControlDemo.UserControl
{
public partial class TextDialogWithTimer
{
public TextDialogWithTimer()
{
InitializeComponent();
var animation = AnimationHelper.CreateAnimation(100, 5000);
animation.EasingFunction = null;
animation.Completed += Animation_Completed;
ProgressBarTimer.BeginAnimation(RangeBase.ValueProperty, animation);
}
private void Animation_Completed(object sender, EventArgs e)
{
ButtonClose.Command.Execute(null);
}
}
}
@@ -0,0 +1,71 @@
<UserControl x:Class="HandyControlDemo.UserControl.ButtonGroupDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{DynamicResource RegionBrush}"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs">
<hc:TransitioningContentControl>
<WrapPanel Margin="16" VerticalAlignment="Center">
<StackPanel Margin="16">
<hc:ButtonGroup>
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
</hc:ButtonGroup>
<hc:ButtonGroup Margin="0,32,0,0">
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
</hc:ButtonGroup>
<hc:ButtonGroup Margin="0,32,0,0" Style="{StaticResource ButtonGroupSolid}">
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
</hc:ButtonGroup>
<hc:ButtonGroup Margin="0,32,0,0">
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
</hc:ButtonGroup>
</StackPanel>
<StackPanel Margin="16" Orientation="Horizontal">
<hc:ButtonGroup Orientation="Vertical">
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
</hc:ButtonGroup>
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
</hc:ButtonGroup>
<hc:ButtonGroup Margin="32,0,0,0" Style="{StaticResource ButtonGroupSolid}" Orientation="Vertical">
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
</hc:ButtonGroup>
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<Button Content="{x:Static langs:Lang.Button}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
</hc:ButtonGroup>
</StackPanel>
</WrapPanel>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,40 @@
using System.Windows;
using System.Windows.Media.Imaging;
namespace HandyControlDemo.UserControl
{
public partial class ButtonGroupDemoCtl
{
public ButtonGroupDemoCtl()
{
InitializeComponent();
}
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
public BitmapFrame Source
{
get => (BitmapFrame) GetValue(SourceProperty);
set => SetValue(SourceProperty, value);
}
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string DisplayName
{
get => (string) GetValue(UserNameProperty);
set => SetValue(UserNameProperty, value);
}
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string Link
{
get => (string) GetValue(LinkProperty);
set => SetValue(LinkProperty, value);
}
}
}
@@ -0,0 +1,34 @@
<UserControl x:Class="HandyControlDemo.UserControl.CardDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{DynamicResource RegionBrush}"
DataContext="{Binding CardDemo,Source={StaticResource Locator}}"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:data="clr-namespace:HandyControlDemo.Data">
<hc:TransitioningContentControl>
<ListBox Margin="32" BorderThickness="0" Style="{StaticResource WrapPanelHorizontalListBox}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}" ItemsSource="{Binding DataList}">
<ListBox.ItemTemplate>
<DataTemplate DataType="data:CardModel">
<hc:Card MaxWidth="240" BorderThickness="0" Effect="{StaticResource EffectShadow2}" Margin="8" Footer="{Binding Footer}">
<!--<hc:Card.HeaderTemplate>
<DataTemplate>
<TextBlock HorizontalAlignment="Left" Style="{StaticResource TextBlockLargeBold}" Text="{Binding}" Margin="10"/>
</DataTemplate>
</hc:Card.HeaderTemplate>-->
<Border CornerRadius="4,4,0,0" Style="{StaticResource BorderClip}">
<Image Width="240" Height="240" Source="{Binding Content}" Stretch="Uniform"/>
</Border>
<hc:Card.FooterTemplate>
<DataTemplate>
<StackPanel Margin="10">
<TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Style="{StaticResource TextBlockLargeBold}" Text="{Binding DataContext.Header,RelativeSource={RelativeSource AncestorType=hc:Card}}" HorizontalAlignment="Left"/>
<TextBlock TextWrapping="NoWrap" TextTrimming="CharacterEllipsis" Style="{StaticResource TextBlockDefault}" Text="{Binding}" Margin="0,6,0,0" HorizontalAlignment="Left"/>
</StackPanel>
</DataTemplate>
</hc:Card.FooterTemplate>
</hc:Card>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class CardDemoCtl
{
public CardDemoCtl()
{
InitializeComponent();
}
}
}
@@ -9,6 +9,7 @@
<hc:TransitioningContentControl>
<StackPanel Margin="32" VerticalAlignment="Center">
<Button Content="{x:Static langs:Lang.TextDialog}" Command="{Binding ShowTextCmd}" />
<Button Margin="0,32,0,0" Content="{x:Static langs:Lang.TextDialogWithTimer}" Command="{Binding ShowInteractiveDialogCmd}" CommandParameter="True"/>
<TextBox Margin="0,32,0,0" Text="{Binding DialogResult,UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource TextBoxExtend}" hc:InfoElement.Placeholder="{x:Static langs:Lang.PleaseInput}"/>
<Button Margin="0,10,0,0" Content="{x:Static langs:Lang.InteractiveDialog}" Command="{Binding ShowInteractiveDialogCmd}"/>
<Button Margin="0,32,0,0" Content="{x:Static langs:Lang.NewWindow}" Command="{Binding NewWindowCmd}"/>
@@ -4,10 +4,6 @@
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}">
<hc:TransitioningContentControl>
<hc:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300">
<hc:GifImage.Source>
<BitmapImage UriSource="/HandyControlDemo;component/Resources/Img/car_chase.gif"/>
</hc:GifImage.Source>
</hc:GifImage>
<hc:GifImage x:Name="GifImageMain" Margin="32" Width="400" Height="300" Uri="/HandyControlDemo;component/Resources/Img/car_chase.gif"/>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,20 @@
<UserControl x:Class="HandyControlDemo.UserControl.ImageBlockDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{DynamicResource RegionBrush}"
xmlns:hc="https://handyorg.github.io/handycontrol">
<hc:TransitioningContentControl>
<UniformGrid Rows="3" Columns="4" Margin="32">
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="0" EndColumn="7" EndRow="0" Width="110" Height="128" IsPlaying="True"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="1" EndColumn="7" EndRow="1" Width="110" Height="128" IsPlaying="True"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="2" EndColumn="7" EndRow="2" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="3" EndColumn="7" EndRow="3" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.1" Columns="8" Rows="10" StartColumn="0" StartRow="4" EndColumn="7" EndRow="4" Width="110" Height="128" IsPlaying="True"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="5" EndColumn="7" EndRow="5" Width="110" Height="128" IsPlaying="True"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="6" EndColumn="7" EndRow="6" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.1" Columns="8" Rows="10" StartColumn="0" StartRow="7" EndColumn="7" EndRow="7" Width="110" Height="128" IsPlaying="True"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="8" EndColumn="7" EndRow="8" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
<hc:ImageBlock Source="/HandyControlDemo;component/Resources/Img/Dance.png" Interval="0:0:0.125" Columns="8" Rows="10" StartColumn="0" StartRow="9" EndColumn="7" EndRow="9" Width="110" Height="128" IsPlaying="{Binding IsMouseOver,RelativeSource={RelativeSource Self}}"/>
</UniformGrid>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class ImageBlockDemoCtl
{
public ImageBlockDemoCtl()
{
InitializeComponent();
}
}
}
@@ -0,0 +1,17 @@
<UserControl x:Class="HandyControlDemo.UserControl.MagnifierDemoCtl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Background="{DynamicResource RegionBrush}"
xmlns:hc="https://handyorg.github.io/handycontrol">
<hc:TransitioningContentControl>
<WrapPanel Margin="16">
<Image Margin="16" hc:Magnifier.Instance="{x:Static hc:Magnifier.Default}" Source="/HandyControlDemo;component/Resources/Img/b1.jpg" Stretch="None"/>
<Image Margin="16" Source="/HandyControlDemo;component/Resources/Img/b1.jpg" Stretch="None">
<hc:Magnifier.Instance>
<hc:Magnifier Scale="6" HorizontalOffset="-16" VerticalOffset="-16"/>
</hc:Magnifier.Instance>
</Image>
</WrapPanel>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class MagnifierDemoCtl
{
public MagnifierDemoCtl()
{
InitializeComponent();
}
}
}
@@ -5,13 +5,23 @@
xmlns:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}">
<hc:TransitioningContentControl>
<StackPanel Margin="32" Width="300" Button.Click="ButtonProgress_OnClick" VerticalAlignment="Center">
<hc:ProgressButton IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
</StackPanel>
<WrapPanel Margin="16" VerticalAlignment="Center">
<StackPanel Margin="16" Button.Click="ButtonProgress_OnClick">
<hc:ProgressButton IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<hc:ProgressButton Style="{StaticResource ProgressButtonDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Progress="{Binding Progress}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
</StackPanel>
<StackPanel Margin="16" Button.Click="ButtonProgress_OnClick">
<ToggleButton Style="{StaticResource ToggleButtonLoading}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<ToggleButton Style="{StaticResource ToggleButtonLoadingPrimary}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<ToggleButton Style="{StaticResource ToggleButtonLoadingSuccess}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<ToggleButton Style="{StaticResource ToggleButtonLoadingInfo}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<ToggleButton Style="{StaticResource ToggleButtonLoadingWarning}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
<ToggleButton Style="{StaticResource ToggleButtonLoadingDanger}" IsChecked="{Binding IsUploading,Mode=TwoWay}" Content="{Binding IsChecked,RelativeSource={RelativeSource Self},Converter={StaticResource Boolean2StrConverter},ConverterParameter={x:Static langs:Lang.UploadStr}}" Width="180" Margin="5"/>
</StackPanel>
</WrapPanel>
</hc:TransitioningContentControl>
</UserControl>
@@ -195,6 +195,16 @@
</hc:StatusSwitchElement.CheckedElement>
</ToggleButton>
<ListBox Name="ListBoxControl" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ImageBlockDemoCtl}" Content="{x:Static langs:Lang.ImageBlock}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ImageStack_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.MagnifierDemoCtl}" Content="{x:Static langs:Lang.Magnifier}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/Search_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.GravatarDemoCtl}" Content="{x:Static langs:Lang.Gravatar}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/User_16x.png"/>
@@ -210,6 +220,11 @@
<Image Source="../../Resources/Img/LeftMainContent/GoToTop_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ButtonGroupDemoCtl}" Content="{x:Static langs:Lang.ButtonGroup}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ButtonGroup_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressButtonDemoCtl}" Content="{x:Static langs:Lang.ProgressButton}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ProgressButton_16x.png"/>
@@ -220,7 +235,7 @@
<Image Source="../../Resources/Img/LeftMainContent/Bubble_16xLG.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.NotifyIconDemoCtl}" Content="{x:Static langs:Lang.NotifyIcon}">
<ListBoxItem Tag="{x:Static data:MessageToken.NotifyIconDemoCtl}" Content="{x:Static langs:Lang.NotifyIcon}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/NotificationHub_16x.png"/>
</hc:EdgeElement.LeftContent>
@@ -310,12 +325,17 @@
<Image Source="../../Resources/Img/LeftMainContent/TextBlock_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.CardDemoCtl}" Content="{x:Static langs:Lang.Card}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/VSO_Card_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Tag="{x:Static data:MessageToken.CirclePanelDemoCtl}" Content="{x:Static langs:Lang.CirclePanel}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/ColorWheel_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.GridDemoCtl}" Content="{x:Static langs:Lang.Grid}">
<ListBoxItem Tag="{x:Static data:MessageToken.GridDemoCtl}" Content="{x:Static langs:Lang.Grid}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/GridPane_16x.png"/>
</hc:EdgeElement.LeftContent>
@@ -405,7 +425,7 @@
<Image Source="../../Resources/Img/LeftMainContent/TabPage_16x.png"/>
</hc:EdgeElement.LeftContent>
</ListBoxItem>
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.SideMenuDemoCtl}" Content="{x:Static langs:Lang.SideMenu}">
<ListBoxItem Tag="{x:Static data:MessageToken.SideMenuDemoCtl}" Content="{x:Static langs:Lang.SideMenu}">
<hc:EdgeElement.LeftContent>
<Image Source="../../Resources/Img/LeftMainContent/MainMenuControl_16x.png"/>
</hc:EdgeElement.LeftContent>
@@ -0,0 +1,99 @@
<Grid x:Class="HandyControlDemo.UserControl.NoUserContent"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Height="29"
DataContext="{Binding NoUser,Source={StaticResource Locator}}"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:data="clr-namespace:HandyControlDemo.Data">
<Grid.ColumnDefinitions>
<ColumnDefinition/>
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel VerticalAlignment="Stretch" Orientation="Horizontal">
<Menu Margin="10,0,0,0" Background="Transparent">
<MenuItem Height="29" Header="{x:Static langs:Lang.Repository}">
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/NaBian/HandyControl" Header="GitHub">
<MenuItem.Icon>
<Path Data="{StaticResource GithubGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.nuget.org/packages/HandyControl" Header="NuGet">
<MenuItem.Icon>
<Path Data="{StaticResource NugetGeometry}" Fill="#30a5dd"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Height="29" Header="{x:Static langs:Lang.About}">
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ContributorsView}" Header="{x:Static langs:Lang.Contributors}">
<MenuItem.Icon>
<Path Data="{StaticResource ContributorsGeometry}" Fill="#ef6c00"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.QQGroupView}" Header="{x:Static langs:Lang.QQGroup}">
<MenuItem.Icon>
<Path Data="{StaticResource QqGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="mailto:836904362@qq.com" Header="{x:Static langs:Lang.Email}">
<MenuItem.Icon>
<Path Data="{StaticResource EmailGeometry}" Fill="{DynamicResource WarningBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://gitter.im/HandyControl/Lobby" Header="{x:Static langs:Lang.Chatroom}">
<MenuItem.Icon>
<Path Data="{StaticResource GitterGeometry}" Fill="#e52e64"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://www.cnblogs.com/nabian" Header="{x:Static langs:Lang.Blog}">
<MenuItem.Icon>
<Path Data="{StaticResource CnblogsGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static langs:Lang.About}" Click="MenuAbout_OnClick">
<MenuItem.Icon>
<Path Data="{StaticResource InfoGeometry}" Fill="{DynamicResource SuccessBrush}"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Height="29" Header="{x:Static langs:Lang.Recommendation}">
<MenuItem Header="{x:Static langs:Lang.Project}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ProjectsView}" >
<MenuItem.Icon>
<Path Data="{StaticResource ProjectGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static langs:Lang.Blog}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.BlogsView}" >
<MenuItem.Icon>
<Path Data="{StaticResource BlogGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>
</StackPanel>
<Button Grid.Column="1" Click="ButtonConfig_OnClick" Name="ButtonConfig" Style="{StaticResource ButtonIcon}" Foreground="{DynamicResource PrimaryTextBrush}" hc:IconElement.Geometry="{StaticResource ConfigGeometry}"/>
<Popup AllowsTransparency="True" Grid.Column="1" PlacementTarget="{Binding ElementName=ButtonConfig}" HorizontalOffset="-25" Name="PopupConfig" VerticalOffset="6" StaysOpen="False">
<Border Background="{DynamicResource SecondaryRegionBrush}" CornerRadius="4" Margin="16" Effect="{StaticResource EffectShadow2}">
<StackPanel Orientation="Horizontal">
<StackPanel Button.Click="ButtonLangs_OnClick" Margin="10,10,0,10">
<Button Tag="zh-cn" Style="{StaticResource ButtonCustom}">
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/cn.png"/>
</Button>
<Button Tag="en" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
<Image Width="32" Source="/HandyControlDemo;component/Resources/Img/Flag/en.png"/>
</Button>
</StackPanel>
<StackPanel Button.Click="ButtonSkins_OnClick" Margin="10,10,10,10">
<Button Tag="{x:Static hc:SkinType.Default}" Style="{StaticResource ButtonCustom}">
<Border Background="White" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
</Button>
<Button Tag="{x:Static hc:SkinType.Dark}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
<Border Background="Black" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
</Button>
<Button Tag="{x:Static hc:SkinType.Violet}" Style="{StaticResource ButtonCustom}" Margin="0,10,0,0">
<Border Background="DarkViolet" Width="32" Height="21" CornerRadius="2" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}"/>
</Button>
</StackPanel>
</StackPanel>
</Border>
</Popup>
</Grid>
@@ -0,0 +1,60 @@
using System.Diagnostics;
using System.Windows;
using System.Windows.Controls;
using HandyControl.Controls;
using HandyControl.Data;
using HandyControlDemo.Data;
using HandyControlDemo.Window;
namespace HandyControlDemo.UserControl
{
public partial class NoUserContent
{
public NoUserContent()
{
InitializeComponent();
}
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Button button && button.Tag is string tag)
{
PopupConfig.IsOpen = false;
if (tag.Equals(GlobalData.Config.Lang)) return;
Growl.Ask(Properties.Langs.Lang.ChangeLangAsk, b =>
{
if (!b) return true;
GlobalData.Config.Lang = tag;
GlobalData.Save();
var processModule = Process.GetCurrentProcess().MainModule;
if (processModule != null)
Process.Start(processModule.FileName);
Application.Current.Shutdown();
return true;
});
}
}
private void ButtonConfig_OnClick(object sender, RoutedEventArgs e) => PopupConfig.IsOpen = true;
private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
{
if (e.OriginalSource is Button button && button.Tag is SkinType tag)
{
PopupConfig.IsOpen = false;
if (tag.Equals(GlobalData.Config.Skin)) return;
GlobalData.Config.Skin = tag;
GlobalData.Save();
((App)Application.Current).UpdateSkin(tag);
}
}
private void MenuAbout_OnClick(object sender, RoutedEventArgs e)
{
new AboutWindow
{
Owner = Application.Current.MainWindow
}.ShowDialog();
}
}
}
@@ -58,31 +58,31 @@
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="Radio"/>
</UniformGrid>
</StackPanel>
<hc:RadioGroup Margin="0,32,0,0">
<hc:ButtonGroup Margin="0,32,0,0">
<RadioButton Content="Radio" IsChecked="True"/>
<RadioButton Content="Radio"/>
<RadioButton IsEnabled="False" Content="Radio"/>
<RadioButton Content="Radio"/>
</hc:RadioGroup>
<hc:RadioGroup Margin="0,16,0,0" Style="{StaticResource RadioGroupSolid}">
</hc:ButtonGroup>
<hc:ButtonGroup Margin="0,16,0,0" Style="{StaticResource ButtonGroupSolid}">
<RadioButton Content="Radio"/>
<RadioButton Content="Radio"/>
<RadioButton IsEnabled="False" Content="Radio"/>
<RadioButton Content="Radio" IsChecked="True"/>
</hc:RadioGroup>
</hc:ButtonGroup>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<hc:RadioGroup Margin="0,16,8,0" Orientation="Vertical">
<hc:ButtonGroup Margin="0,16,8,0" Orientation="Vertical">
<RadioButton Content="Radio" IsChecked="True"/>
<RadioButton Content="Radio"/>
<RadioButton IsEnabled="False" Content="Radio"/>
<RadioButton Content="Radio"/>
</hc:RadioGroup>
<hc:RadioGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource RadioGroupSolid}">
</hc:ButtonGroup>
<hc:ButtonGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource ButtonGroupSolid}">
<RadioButton Content="Radio"/>
<RadioButton Content="Radio"/>
<RadioButton IsEnabled="False" Content="Radio"/>
<RadioButton Content="Radio" IsChecked="True"/>
</hc:RadioGroup>
</hc:ButtonGroup>
</StackPanel>
</StackPanel>
</Border>
@@ -156,19 +156,19 @@
<ProgressBar Style="{StaticResource ProgressBarFlat}" Margin="0,8,0,10" Value="110" Maximum="200" />
</StackPanel>
</Border>
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="859" Height="264" Canvas.Top="130">
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="859" Height="262" Canvas.Top="130">
<ScrollViewer>
<StackPanel VerticalAlignment="Top">
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
<StackPanel VerticalAlignment="Top" Width="206">
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
<Expander Header="Title" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
<Expander Header="Title" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Width="206" HorizontalAlignment="Left">
<Expander Header="Title" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
</StackPanel>
@@ -314,7 +314,7 @@
</hc:Badge>
</StackPanel>
</Border>
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="128" Canvas.Top="310" Width="162" Height="84">
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="128" Canvas.Top="310" Width="160" Height="84">
<WrapPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<hc:Shield Subject="chat" Status="on gitter" Margin="0,0,0,0" Color="#4eb899" Command="hc:ControlCommands.OpenLink" CommandParameter="https://gitter.im/HandyControl/Lobby?utm_source=badge&amp;utm_medium=badge&amp;utm_campaign=pr-badge&amp;utm_content=badge"/>
<hc:Shield Subject="qq" Status="714704041" Margin="0,4,0,0" Color="#d8624c" Command="hc:ControlCommands.OpenLink" CommandParameter="http://shang.qq.com/wpa/qunwpa?idkey=a571e5553c9d41e49c4f22f3a8b2865451497a795ff281fedf3285def247efc1"/>
@@ -343,13 +343,13 @@
</hc:Transfer.ItemTemplate>
</hc:Transfer>
</Border>
<Border Visibility="Collapsed" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="611" Canvas.Top="976">
<userControl:CoverFlowDemoCtl Width="563" Margin="-32" Background="Transparent"/>
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="611" Canvas.Top="976">
<userControl:CoverFlowDemoCtl Width="559" Margin="-32" Background="Transparent"/>
</Border>
<Border Visibility="Collapsed" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1391" Canvas.Top="648" Width="274">
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1391" Canvas.Top="648" Width="274">
<userControl:ColorPickerDemoCtl Margin="-32" Background="Transparent"/>
</Border>
<Border Visibility="Collapsed" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1113" Canvas.Top="608" Width="264" Height="126">
<Border Visibility="Visible" BorderThickness="0" Padding="16" Style="{StaticResource BorderRegion}" CornerRadius="4" Canvas.Left="1113" Canvas.Top="608" Width="264" Height="126">
<hc:TagPanel Orientation="Horizontal" MaxWidth="400" VerticalAlignment="Center">
<hc:Tag ShowCloseButton="False" Content="TextText"/>
<hc:Tag Content="Text"/>
@@ -5,17 +5,17 @@
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
xmlns:hc="https://handyorg.github.io/handycontrol">
<hc:TransitioningContentControl>
<StackPanel Margin="32" VerticalAlignment="Center">
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
<StackPanel Margin="32" VerticalAlignment="Center" Width="240">
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1,1,1,0" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}" Width="240" HorizontalAlignment="Left">
<Expander Header="{x:Static langs:Lang.Title}" BorderThickness="1" BorderBrush="{DynamicResource BorderBrush}">
<Border Height="100" Background="{DynamicResource SecondaryRegionBrush}"/>
</Expander>
</StackPanel>
@@ -20,31 +20,31 @@
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="{x:Static langs:Lang.RadioButton}"/>
</UniformGrid>
</StackPanel>
<hc:RadioGroup Margin="0,32,0,0">
<hc:ButtonGroup Margin="0,32,0,0">
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
</hc:RadioGroup>
<hc:RadioGroup Margin="0,16,0,0" Style="{StaticResource RadioGroupSolid}">
</hc:ButtonGroup>
<hc:ButtonGroup Margin="0,16,0,0" Style="{StaticResource ButtonGroupSolid}">
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
</hc:RadioGroup>
</hc:ButtonGroup>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
<hc:RadioGroup Margin="0,16,8,0" Orientation="Vertical">
<hc:ButtonGroup Margin="0,16,8,0" Orientation="Vertical">
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
</hc:RadioGroup>
<hc:RadioGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource RadioGroupSolid}">
</hc:ButtonGroup>
<hc:ButtonGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource ButtonGroupSolid}">
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
</hc:RadioGroup>
</hc:ButtonGroup>
</StackPanel>
</StackPanel>
</hc:TransitioningContentControl>
@@ -11,7 +11,7 @@ namespace HandyControlDemo.ViewModel.Basic
{
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<string>
{
public Action<string> CloseAction { get; set; }
public Action CloseAction { get; set; }
private string _result;
@@ -37,6 +37,6 @@ namespace HandyControlDemo.ViewModel.Basic
#endif
}
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke(""))).Value;
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke())).Value;
}
}
@@ -0,0 +1,13 @@
using HandyControlDemo.Data;
using HandyControlDemo.Service;
namespace HandyControlDemo.ViewModel
{
public class CardDemoViewModel : DemoViewModelBase<CardModel>
{
public CardDemoViewModel(DataService dataService)
{
DataList = dataService.GetCardDataList();
}
}
}
@@ -9,8 +9,8 @@ using GalaSoft.MvvmLight.CommandWpf;
#endif
using HandyControl.Controls;
using HandyControl.Tools.Extension;
using HandyControlDemo.Data;
using HandyControlDemo.UserControl;
using HandyControlDemo.UserControl.Basic;
using HandyControlDemo.ViewModel.Basic;
using HandyControlDemo.Window;
@@ -39,24 +39,38 @@ namespace HandyControlDemo.ViewModel
}
#if netle40
public RelayCommand ShowInteractiveDialogCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(ShowInteractiveDialog)).Value;
public RelayCommand<bool> ShowInteractiveDialogCmd => new Lazy<RelayCommand<bool>>(() =>
new RelayCommand<bool>(ShowInteractiveDialog)).Value;
private void ShowInteractiveDialog()
private void ShowInteractiveDialog(bool withTimer)
{
Dialog.Show<InteractiveDialog>()
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
.GetResultAsync<string>().ContinueWith(str => DialogResult = str.Result);
if (!withTimer)
{
Dialog.Show<InteractiveDialog>()
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
.GetResultAsync<string>().ContinueWith(str => DialogResult = str.Result);
}
else
{
Dialog.Show<TextDialogWithTimer>(MessageToken.MainWindow).GetResultAsync<string>();
}
}
#else
public RelayCommand ShowInteractiveDialogCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(async () => await ShowInteractiveDialog())).Value;
public RelayCommand<bool> ShowInteractiveDialogCmd => new Lazy<RelayCommand<bool>>(() =>
new RelayCommand<bool>(async withTimer => await ShowInteractiveDialog(withTimer))).Value;
private async Task ShowInteractiveDialog()
private async Task ShowInteractiveDialog(bool withTimer)
{
DialogResult = await Dialog.Show<InteractiveDialog>()
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
.GetResultAsync<string>();
if (!withTimer)
{
DialogResult = await Dialog.Show<InteractiveDialog>()
.Initialize<InteractiveDialogViewModel>(vm => vm.Message = DialogResult)
.GetResultAsync<string>();
}
else
{
await Dialog.Show<TextDialogWithTimer>(MessageToken.MainWindow).GetResultAsync<string>();
}
}
#endif
@@ -39,7 +39,7 @@ namespace HandyControlDemo.ViewModel
public PaginationDemoViewModel(DataService dataService)
{
_totalDataList = dataService.GetDemoDataList(100);
_totalDataList = dataService.GetDemoDataList(10);
DataList = _totalDataList.Take(10).ToList();
}
@@ -38,6 +38,7 @@ namespace HandyControlDemo.ViewModel
SimpleIoc.Default.Register<SideMenuDemoViewModel>();
SimpleIoc.Default.Register<TabControlDemoViewModel>();
SimpleIoc.Default.Register<NoUserViewModel>();
SimpleIoc.Default.Register<CardDemoViewModel>();
}
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
@@ -87,6 +88,8 @@ namespace HandyControlDemo.ViewModel
public NoUserViewModel NoUser => ServiceLocator.Current.GetInstance<NoUserViewModel>();
public CardDemoViewModel CardDemo => ServiceLocator.Current.GetInstance<CardDemoViewModel>();
#endregion
}
}
@@ -8,7 +8,6 @@
mc:Ignorable="d"
WindowStartupLocation="CenterScreen"
Title="{x:Static langs:Lang.Title}"
ShowTitle="True"
Style="{StaticResource WindowBlur}"
Height="450"
Width="800"
@@ -6,7 +6,6 @@
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
mc:Ignorable="d"
ShowTitle="True"
Background="{DynamicResource MainContentBackgroundBrush}"
WindowStartupLocation="CenterScreen"
Style="{StaticResource WindowWin10}"
@@ -8,12 +8,12 @@
mc:Ignorable="d"
OtherButtonForeground="{DynamicResource ReverseTextBrush}"
CloseButtonForeground="{DynamicResource ReverseTextBrush}"
OtherButtonHoverBackground="{DynamicResource ReverseTextBrush}"
NonClientAreaBackground="{DynamicResource ToolBarBackground}"
NonClientAreaHeight="69"
Background="{DynamicResource MainContentBackgroundBrush}"
WindowStartupLocation="CenterScreen"
Style="{StaticResource WindowWin10}"
ShowTitle="False"
Title="{x:Static langs:Lang.Title}"
Height="450"
Width="800">