No files matched your search
@@ -48,6 +48,10 @@ Step 3:enjoy coding
|
||||
|
||||
## Latest examples
|
||||
|
||||
### SideMenu
|
||||
|
||||

|
||||
|
||||
### NotifyIcon
|
||||
|
||||

|
||||
@@ -64,12 +68,12 @@ Step 3:enjoy coding
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### Gravatar
|
||||
|
||||

|
||||
|
||||
## History publication
|
||||
|
||||
### GoToTop
|
||||
|
||||

|
||||
|
||||
|
After Width: | Height: | Size: 12 KiB |
@@ -321,6 +321,30 @@
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\under_construction.gif">
|
||||
<Link>Resources\Img\under_construction.gif</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Boards.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Boards.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Overview.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Overview.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Pipelines.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Pipelines.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Repos.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Repos.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-TestPlans.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-TestPlans.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
||||
<Link>Resources\fabric-icons.ttf</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=HandyControl_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -381,13 +381,35 @@
|
||||
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
||||
<Link>Resources\fabric-icons.ttf</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\..\Shared\HandyControlDemo_Shared\Data\MessageToken.tt">
|
||||
<Link>Data\MessageToken.tt</Link>
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Boards.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Boards.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Overview.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Overview.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Pipelines.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Pipelines.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Repos.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Repos.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-TestPlans.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-TestPlans.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\RepeatButton_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\RepeatButton_16x.png</Link>
|
||||
</Resource>
|
||||
|
||||
@@ -411,6 +411,29 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Boards.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Boards.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Overview.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Overview.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Pipelines.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Pipelines.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-Repos.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-Repos.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\DevOps\DevOps-TestPlans.png">
|
||||
<Link>Resources\Img\DevOps\DevOps-TestPlans.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
||||
<Link>Resources\fabric-icons.ttf</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace HandyControlDemo
|
||||
base.OnStartup(e);
|
||||
|
||||
GlobalData.Init();
|
||||
Thread.CurrentThread.CurrentUICulture = new CultureInfo(GlobalData.Config.Lang);
|
||||
ConfigHelper.Instance.SetLang(GlobalData.Config.Lang);
|
||||
|
||||
if (GlobalData.Config.Skin != SkinType.Default)
|
||||
{
|
||||
@@ -28,7 +28,7 @@ namespace HandyControlDemo
|
||||
}
|
||||
|
||||
#if !Core
|
||||
BlurWindow.SystemVersionInfo = CommonHelper.GetSystemVersionInfo();
|
||||
ConfigHelper.Instance.SetSystemVersionInfo(CommonHelper.GetSystemVersionInfo());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@
|
||||
|
||||
public static readonly string DialogDemoCtl = nameof(DialogDemoCtl);
|
||||
|
||||
public static readonly string SideMenuDemoCtl = nameof(SideMenuDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
||||
|
||||
@@ -48,7 +48,8 @@ var controlList = new List<string>
|
||||
"NotifyIconDemoCtl",
|
||||
"BadgeDemoCtl",
|
||||
"GravatarDemoCtl",
|
||||
"DialogDemoCtl"
|
||||
"DialogDemoCtl",
|
||||
"SideMenuDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -146,6 +146,9 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ShieldDemoCtl.xaml.cs">
|
||||
<DependentUpon>ShieldDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\SideMenuDemoCtl.xaml.cs">
|
||||
<DependentUpon>SideMenuDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\StepBarDemoCtl.xaml.cs">
|
||||
<DependentUpon>StepBarDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -280,6 +283,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\NotifyIconDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\PaginationDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SearchBarDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\SideMenuDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\StepBarDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\Controls\WindowDemoViewModel.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)ViewModel\DemoViewModelBase!1.cs" />
|
||||
@@ -333,6 +337,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Resources\Themes\Basic\Fonts.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Resources\Themes\Basic\Geometries.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -505,6 +513,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\SideMenuDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\StepBarDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -1158,6 +1158,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 侧边菜单 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string SideMenu {
|
||||
get {
|
||||
return ResourceManager.GetString("SideMenu", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 滑块 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -576,4 +576,7 @@
|
||||
<data name="ShowInMainWindow" xml:space="preserve">
|
||||
<value>Show in the main window</value>
|
||||
</data>
|
||||
<data name="SideMenu" xml:space="preserve">
|
||||
<value>SideMenu</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -576,4 +576,7 @@
|
||||
<data name="ShowInMainWindow" xml:space="preserve">
|
||||
<value>在主窗口显示</value>
|
||||
</data>
|
||||
<data name="SideMenu" xml:space="preserve">
|
||||
<value>侧边菜单</value>
|
||||
</data>
|
||||
</root>
|
||||
|
After Width: | Height: | Size: 4.8 KiB |
|
After Width: | Height: | Size: 3.5 KiB |
|
After Width: | Height: | Size: 5.3 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 5.2 KiB |
|
After Width: | Height: | Size: 155 B |
@@ -4,6 +4,7 @@
|
||||
<ResourceDictionary Source="Brushes.xaml"/>
|
||||
<ResourceDictionary Source="Geometries.xaml"/>
|
||||
<ResourceDictionary Source="Converters.xaml"/>
|
||||
<ResourceDictionary Source="Fonts.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<FontFamily x:Key="FabricIcons">pack://application:,,,/HandyControlDemo;component/Resources/fabric-icons.ttf#Fabric MDL2 Assets</FontFamily>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
<ResourceDictionary Source="../Basic/Fonts.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button">
|
||||
@@ -99,4 +100,9 @@
|
||||
<Setter Property="CloseButtonForeground" Value="White"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TextBlockFabricIcons" TargetType="TextBlock">
|
||||
<Setter Property="FontFamily" Value="{StaticResource FabricIcons}"/>
|
||||
<Setter Property="FontSize" Value="14"/>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,155 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.SideMenuDemoCtl"
|
||||
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:i="http://schemas.microsoft.com/expression/2010/interactivity"
|
||||
xmlns:command="http://www.galasoft.ch/mvvmlight"
|
||||
DataContext="{Binding SideMenuDemo,Source={StaticResource Locator}}"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
|
||||
<controls:TransitioningContentControl>
|
||||
<controls:SideMenu BorderThickness="1" Width="200" Margin="32">
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<command:EventToCommand Command="{Binding SwitchItemCmd}" PassEventArgsToCommand="True" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<controls:SideMenuItem Header="Overview">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<Image Source="/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Overview.png" Width="24" Height="24"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
<controls:SideMenuItem Header="Summary">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Dashboards">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Wiki">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Boards">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<Image Source="/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Boards.png" Width="24" Height="24"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
<controls:SideMenuItem Header="Work Items">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Boards">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Backlogs">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Sprints">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Queries">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Repos">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<Image Source="/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Repos.png" Width="24" Height="24"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
<controls:SideMenuItem Header="Files">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Commits">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Pushes">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Branches">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Tags">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Pull requests">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Pipelines">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<Image Source="/HandyControlDemo;component/Resources/Img/DevOps/DevOps-Pipelines.png" Width="24" Height="24"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
<controls:SideMenuItem Header="Builds">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Releases">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Library">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Task groups">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Deployment groups">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Test Plans">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<Image Source="/HandyControlDemo;component/Resources/Img/DevOps/DevOps-TestPlans.png" Width="24" Height="24"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
<controls:SideMenuItem Header="Test Plans">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Runs">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
<controls:SideMenuItem Header="Load test">
|
||||
<controls:SideMenuItem.Icon>
|
||||
<TextBlock Text="" Style="{StaticResource TextBlockFabricIcons}"/>
|
||||
</controls:SideMenuItem.Icon>
|
||||
</controls:SideMenuItem>
|
||||
</controls:SideMenuItem>
|
||||
</controls:SideMenu>
|
||||
</controls:TransitioningContentControl>
|
||||
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class SideMenuDemoCtl
|
||||
{
|
||||
public SideMenuDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@
|
||||
</controls: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.GravatarDemoCtl}" Content="{x:Static langs:Lang.Gravatar}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.GravatarDemoCtl}" Content="{x:Static langs:Lang.Gravatar}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/User_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
@@ -203,7 +203,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/DotLarge_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.GotoTopDemoCtl}" Content="{x:Static langs:Lang.GotoTop}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.GotoTopDemoCtl}" Content="{x:Static langs:Lang.GotoTop}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/GoToTop_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
@@ -393,6 +393,11 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/TabPage_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.SideMenuDemoCtl}" Content="{x:Static langs:Lang.SideMenu}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/MainMenuControl_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.ScrollViewerDemoCtl}" Content="{x:Static langs:Lang.ScrollViewer}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class CalendarDemoCtl
|
||||
{
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using GalaSoft.MvvmLight;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
#if netle40
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
#else
|
||||
using GalaSoft.MvvmLight.CommandWpf;
|
||||
# endif
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
public class SideMenuDemoViewModel : ViewModelBase
|
||||
{
|
||||
public RelayCommand<FunctionEventArgs<object>> SwitchItemCmd => new Lazy<RelayCommand<FunctionEventArgs<object>>>(() =>
|
||||
new RelayCommand<FunctionEventArgs<object>>(SwitchItem)).Value;
|
||||
|
||||
private void SwitchItem(FunctionEventArgs<object> info) => Growl.Info((info.Info as SideMenuItem)?.Header.ToString());
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,7 @@ namespace HandyControlDemo.ViewModel
|
||||
SimpleIoc.Default.Register<NotifyIconDemoViewModel>();
|
||||
SimpleIoc.Default.Register<InteractiveDialogViewModel>();
|
||||
SimpleIoc.Default.Register<BadgeDemoViewModel>();
|
||||
SimpleIoc.Default.Register<SideMenuDemoViewModel>();
|
||||
}
|
||||
|
||||
public static ViewModelLocator Instance => new Lazy<ViewModelLocator>(() =>
|
||||
@@ -71,6 +72,9 @@ namespace HandyControlDemo.ViewModel
|
||||
public InteractiveDialogViewModel InteractiveDialog => ServiceLocator.Current.GetInstance<InteractiveDialogViewModel>();
|
||||
|
||||
public BadgeDemoViewModel BadgeDemo => ServiceLocator.Current.GetInstance<BadgeDemoViewModel>();
|
||||
|
||||
public SideMenuDemoViewModel SideMenuDemo => ServiceLocator.Current.GetInstance<SideMenuDemoViewModel>();
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class HeaderedSimpleItemsControl : SimpleItemsControl
|
||||
{
|
||||
public static readonly DependencyProperty HeaderProperty = DependencyProperty.Register(
|
||||
"Header", typeof(object), typeof(HeaderedSimpleItemsControl), new PropertyMetadata(default(object)));
|
||||
|
||||
public object Header
|
||||
{
|
||||
get => GetValue(HeaderProperty);
|
||||
set => SetValue(HeaderProperty, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Markup;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
@@ -33,7 +34,14 @@ namespace HandyControl.Controls
|
||||
public SimpleItemsControl()
|
||||
{
|
||||
var items = new ObservableCollection<object>();
|
||||
items.CollectionChanged += OnItemsChanged;
|
||||
items.CollectionChanged += (s, e) =>
|
||||
{
|
||||
if (e.NewItems != null && e.NewItems.Count > 0)
|
||||
{
|
||||
SetValue(HasItemsPropertyKey, true);
|
||||
}
|
||||
OnItemsChanged(s, e);
|
||||
};
|
||||
Items = items;
|
||||
}
|
||||
|
||||
@@ -118,6 +126,14 @@ namespace HandyControl.Controls
|
||||
|
||||
protected virtual void OnItemContainerStyleChanged(DependencyPropertyChangedEventArgs e) => Refresh();
|
||||
|
||||
internal static readonly DependencyPropertyKey HasItemsPropertyKey =
|
||||
DependencyProperty.RegisterReadOnly(nameof(HasItems), typeof(bool), typeof(SimpleItemsControl),
|
||||
new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public static readonly DependencyProperty HasItemsProperty = HasItemsPropertyKey.DependencyProperty;
|
||||
|
||||
public bool HasItems => (bool) GetValue(HasItemsProperty);
|
||||
|
||||
protected virtual void Refresh()
|
||||
{
|
||||
if (ItemsHost == null) return;
|
||||
|
||||
@@ -0,0 +1,189 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class SideMenu : HeaderedSimpleItemsControl
|
||||
{
|
||||
private SideMenuItem _selectedItem;
|
||||
|
||||
private SideMenuItem _selectedHeader;
|
||||
|
||||
private bool _isItemSelected;
|
||||
|
||||
public SideMenu()
|
||||
{
|
||||
AddHandler(SideMenuItem.SelectedEvent, new RoutedEventHandler(SideMenuItemSelected));
|
||||
|
||||
Loaded += (s, e) => Init();
|
||||
}
|
||||
|
||||
protected override void Refresh()
|
||||
{
|
||||
base.Refresh();
|
||||
|
||||
Init();
|
||||
}
|
||||
|
||||
private void Init()
|
||||
{
|
||||
if (ItemsHost == null) return;
|
||||
|
||||
OnExpandModeChanged(ExpandMode);
|
||||
}
|
||||
|
||||
private void SideMenuItemSelected(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is SideMenuItem item)
|
||||
{
|
||||
if (item.Role == SideMenuItemRole.Item)
|
||||
{
|
||||
if (Equals(item, _selectedItem)) return;
|
||||
|
||||
if (_selectedItem != null)
|
||||
{
|
||||
_selectedItem.IsSelected = false;
|
||||
}
|
||||
|
||||
_selectedItem = item;
|
||||
_selectedItem.IsSelected = true;
|
||||
RaiseEvent(new FunctionEventArgs<object>(SelectionChangedEvent, this)
|
||||
{
|
||||
Info = e.OriginalSource
|
||||
});
|
||||
_isItemSelected = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!Equals(item, _selectedHeader))
|
||||
{
|
||||
if (_selectedHeader != null)
|
||||
{
|
||||
if (ExpandMode == ExpandMode.Freedom && item.ItemsHost.IsVisible && !_isItemSelected)
|
||||
{
|
||||
item.IsSelected = false;
|
||||
SwitchPanelArea(item);
|
||||
return;
|
||||
}
|
||||
|
||||
_selectedHeader.IsSelected = false;
|
||||
if (ExpandMode != ExpandMode.Freedom)
|
||||
{
|
||||
SwitchPanelArea(_selectedHeader);
|
||||
}
|
||||
}
|
||||
|
||||
_selectedHeader = item;
|
||||
_selectedHeader.IsSelected = true;
|
||||
SwitchPanelArea(_selectedHeader);
|
||||
}
|
||||
else if (ExpandMode == ExpandMode.Freedom && !_isItemSelected)
|
||||
{
|
||||
_selectedHeader.IsSelected = false;
|
||||
SwitchPanelArea(_selectedHeader);
|
||||
_selectedHeader = null;
|
||||
}
|
||||
|
||||
if (_isItemSelected)
|
||||
{
|
||||
_isItemSelected = false;
|
||||
}
|
||||
else if(_selectedHeader != null)
|
||||
{
|
||||
_selectedHeader.SelectDefaultItem();
|
||||
_isItemSelected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SwitchPanelArea(SideMenuItem oldItem)
|
||||
{
|
||||
switch (ExpandMode)
|
||||
{
|
||||
case ExpandMode.ShowAll:
|
||||
return;
|
||||
case ExpandMode.ShowOne:
|
||||
case ExpandMode.Freedom:
|
||||
case ExpandMode.Accordion:
|
||||
oldItem.SwitchPanelArea(oldItem.IsSelected);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override DependencyObject GetContainerForItemOverride() => new SideMenuItem();
|
||||
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is SideMenuItem;
|
||||
|
||||
public static readonly DependencyProperty ExpandModeProperty = DependencyProperty.Register(
|
||||
"ExpandMode", typeof(ExpandMode), typeof(SideMenu), new PropertyMetadata(default(ExpandMode), OnExpandModeChanged));
|
||||
|
||||
private static void OnExpandModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ctl = (SideMenu) d;
|
||||
var v = (ExpandMode) e.NewValue;
|
||||
|
||||
if (ctl.ItemsHost == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ctl.OnExpandModeChanged(v);
|
||||
}
|
||||
|
||||
private void OnExpandModeChanged(ExpandMode mode)
|
||||
{
|
||||
if (mode == ExpandMode.ShowAll)
|
||||
{
|
||||
ShowAll();
|
||||
}
|
||||
else if (mode == ExpandMode.ShowOne)
|
||||
{
|
||||
var sideMenuItem = ItemsHost.Children.OfType<SideMenuItem>().FirstOrDefault(item => item.IsSelected);
|
||||
ShowSelectedOne(sideMenuItem);
|
||||
}
|
||||
}
|
||||
|
||||
public ExpandMode ExpandMode
|
||||
{
|
||||
get => (ExpandMode) GetValue(ExpandModeProperty);
|
||||
set => SetValue(ExpandModeProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty PanelAreaLengthProperty = DependencyProperty.Register(
|
||||
"PanelAreaLength", typeof(double), typeof(SideMenu), new PropertyMetadata(double.NaN));
|
||||
|
||||
public double PanelAreaLength
|
||||
{
|
||||
get => (double) GetValue(PanelAreaLengthProperty);
|
||||
set => SetValue(PanelAreaLengthProperty, value);
|
||||
}
|
||||
|
||||
private void ShowAll()
|
||||
{
|
||||
foreach (var sideMenuItem in ItemsHost.Children.OfType<SideMenuItem>())
|
||||
{
|
||||
sideMenuItem.SwitchPanelArea(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void ShowSelectedOne(SideMenuItem item)
|
||||
{
|
||||
foreach (var sideMenuItem in ItemsHost.Children.OfType<SideMenuItem>())
|
||||
{
|
||||
sideMenuItem.SwitchPanelArea(Equals(sideMenuItem, item));
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly RoutedEvent SelectionChangedEvent = EventManager.RegisterRoutedEvent(
|
||||
"SelectionChanged", RoutingStrategy.Bubble, typeof(EventHandler<FunctionEventArgs<object>>), typeof(SideMenu));
|
||||
|
||||
public event EventHandler<FunctionEventArgs<object>> SelectionChanged
|
||||
{
|
||||
add => AddHandler(SelectionChangedEvent, value);
|
||||
remove => RemoveHandler(SelectionChangedEvent, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,152 @@
|
||||
using System.Linq;
|
||||
using System.Windows;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Input;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class SideMenuItem : HeaderedSimpleItemsControl, ISelectable
|
||||
{
|
||||
private bool _isMouseLeftButtonDown;
|
||||
|
||||
public static readonly DependencyProperty IconProperty = DependencyProperty.Register(
|
||||
"Icon", typeof(object), typeof(SideMenuItem), new PropertyMetadata(default(object)));
|
||||
|
||||
public object Icon
|
||||
{
|
||||
get => GetValue(IconProperty);
|
||||
set => SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
public SideMenuItem()
|
||||
{
|
||||
SetBinding(ExpandModeProperty, new Binding(SideMenu.ExpandModeProperty.Name)
|
||||
{
|
||||
RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(SideMenu), 1)
|
||||
});
|
||||
}
|
||||
|
||||
internal static readonly DependencyProperty ExpandModeProperty =
|
||||
SideMenu.ExpandModeProperty.AddOwner(typeof(SideMenuItem), new PropertyMetadata(default(ExpandMode)));
|
||||
|
||||
internal ExpandMode ExpandMode
|
||||
{
|
||||
get => (ExpandMode) GetValue(ExpandModeProperty);
|
||||
set => SetValue(ExpandModeProperty, value);
|
||||
}
|
||||
|
||||
protected override void Refresh()
|
||||
{
|
||||
if (ItemsHost == null) return;
|
||||
|
||||
ItemsHost.Children.Clear();
|
||||
foreach (var item in Items)
|
||||
{
|
||||
DependencyObject container;
|
||||
if (IsItemItsOwnContainerOverride(item))
|
||||
{
|
||||
container = item as DependencyObject;
|
||||
}
|
||||
else
|
||||
{
|
||||
container = GetContainerForItemOverride();
|
||||
PrepareContainerForItemOverride(container, item);
|
||||
}
|
||||
|
||||
if (container is FrameworkElement element)
|
||||
{
|
||||
element.Style = ItemContainerStyle;
|
||||
ItemsHost.Children.Add(element);
|
||||
}
|
||||
}
|
||||
|
||||
if (IsLoaded)
|
||||
{
|
||||
SwitchPanelArea(ExpandMode == ExpandMode.ShowAll || IsSelected);
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnSelected(RoutedEventArgs e) => RaiseEvent(e);
|
||||
|
||||
public static readonly RoutedEvent SelectedEvent =
|
||||
EventManager.RegisterRoutedEvent("Selected", RoutingStrategy.Bubble,
|
||||
typeof(RoutedEventHandler), typeof(SideMenuItem));
|
||||
|
||||
public event RoutedEventHandler Selected
|
||||
{
|
||||
add => AddHandler(SelectedEvent, value);
|
||||
remove => RemoveHandler(SelectedEvent, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsSelectedProperty = DependencyProperty.Register(
|
||||
"IsSelected", typeof(bool), typeof(SideMenuItem), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool IsSelected
|
||||
{
|
||||
get => (bool) GetValue(IsSelectedProperty);
|
||||
set => SetValue(IsSelectedProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty RoleProperty = DependencyProperty.Register(
|
||||
"Role", typeof(SideMenuItemRole), typeof(SideMenuItem), new PropertyMetadata(default(SideMenuItemRole)));
|
||||
|
||||
public SideMenuItemRole Role
|
||||
{
|
||||
get => (SideMenuItemRole) GetValue(RoleProperty);
|
||||
internal set => SetValue(RoleProperty, value);
|
||||
}
|
||||
|
||||
protected override DependencyObject GetContainerForItemOverride() => new SideMenuItem();
|
||||
|
||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is SideMenuItem;
|
||||
|
||||
protected override void OnMouseLeave(MouseEventArgs e)
|
||||
{
|
||||
base.OnMouseLeave(e);
|
||||
|
||||
_isMouseLeftButtonDown = false;
|
||||
}
|
||||
|
||||
protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonDown(e);
|
||||
|
||||
_isMouseLeftButtonDown = true;
|
||||
}
|
||||
|
||||
protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnMouseLeftButtonUp(e);
|
||||
|
||||
if (_isMouseLeftButtonDown)
|
||||
{
|
||||
IsSelected = true;
|
||||
OnSelected(new RoutedEventArgs(SelectedEvent, this));
|
||||
_isMouseLeftButtonDown = false;
|
||||
}
|
||||
}
|
||||
|
||||
internal void SelectDefaultItem()
|
||||
{
|
||||
if (Role == SideMenuItemRole.Header && ItemsHost.Children.Count > 0)
|
||||
{
|
||||
var item = ItemsHost.Children.OfType<SideMenuItem>().FirstOrDefault();
|
||||
if (item != null && !item.IsSelected)
|
||||
{
|
||||
item.OnSelected(new RoutedEventArgs(SelectedEvent, item));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void SwitchPanelArea(bool isShow)
|
||||
{
|
||||
if (ItemsHost == null) return;
|
||||
if (Role == SideMenuItemRole.Header)
|
||||
{
|
||||
ItemsHost.Show(isShow);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum ExpandMode
|
||||
{
|
||||
/// <summary>
|
||||
/// 最多只能显示一项,且不可折叠
|
||||
/// </summary>
|
||||
ShowOne,
|
||||
|
||||
/// <summary>
|
||||
/// 显示所有项,且不可折叠
|
||||
/// </summary>
|
||||
ShowAll,
|
||||
|
||||
/// <summary>
|
||||
/// 类似ShowOne,但是控件的尺寸不随项的数量而改变
|
||||
/// </summary>
|
||||
Accordion,
|
||||
|
||||
/// <summary>
|
||||
/// 没有任何限制
|
||||
/// </summary>
|
||||
Freedom
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public enum SideMenuItemRole
|
||||
{
|
||||
Header,
|
||||
Item
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public class HandyControlConfig
|
||||
{
|
||||
public SystemVersionInfo SystemVersionInfo { get; set; }
|
||||
|
||||
public string Lang { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\VisualElement.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\WindowAttach.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Base\HeaderedSelectableItem.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Base\HeaderedSimpleItemsControl.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Base\IGravatarGenerator.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Base\ISelectable.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Base\ISingleOpen.cs" />
|
||||
@@ -77,6 +78,8 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\ProgressBar\WaveProgressBar.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Rate\Rate.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Rate\RateItem.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\SideMenu\SideMenu.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\SideMenu\SideMenuItem.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\CompareSlider.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\CompareTrack.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\PreviewSlider.cs" />
|
||||
@@ -109,9 +112,11 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\BadgeStatus.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\ChatMessageType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\ChatRoleType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\ExpandMode.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\InfoType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\IpType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\ResultType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\SideMenuItemRole.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\SkinType.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\StepStatus.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Enum\TextType.cs" />
|
||||
@@ -123,6 +128,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Gif\GifPropertyItemInternal.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Gif\GPStream.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\GrowlInfo.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\HandyControlConfig.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\MessageBoxInfo.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Operation\OperationResult!1.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Operation\OperationResult.cs" />
|
||||
@@ -221,6 +227,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\AnimationHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\ArithmeticHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\ColorHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\ConfigHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\CreateParams.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\DesignerHelper.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Helper\ExternDllHelper.cs" />
|
||||
@@ -439,6 +446,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\SideMenuBaseStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\StepBarBaseStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -639,6 +650,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\SideMenu.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\SimpleItemsControl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<Style x:Key="SideMenuItemBaseStyle" TargetType="controls:SideMenuItem">
|
||||
<Setter Property="Role" Value="Item"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="MinHeight" Value="40"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:SideMenuItem">
|
||||
<Border Name="BorderRoot" Background="{TemplateBinding Background}">
|
||||
<controls:SimplePanel>
|
||||
<Rectangle Width="4" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Left"/>
|
||||
<ContentControl Margin="4,0,0,0">
|
||||
<DockPanel Margin="{TemplateBinding Padding}">
|
||||
<ContentControl Width="40" Name="PresenterIcon">
|
||||
<ContentPresenter ContentSource="Icon" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ContentControl>
|
||||
<ContentPresenter Name="PresenterHeader" ContentSource="Header" Margin="6,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
|
||||
</DockPanel>
|
||||
</ContentControl>
|
||||
</controls:SimplePanel>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="PresenterIcon" Property="Visibility" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<DataTrigger Binding="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=controls:SideMenuItem}}" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
</DataTrigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
<Setter Property="TextElement.FontWeight" Value="Bold" TargetName="PresenterHeader"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SideMenuItemAccordionBaseStyle" BasedOn="{StaticResource SideMenuItemBaseStyle}" TargetType="controls:SideMenuItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:SideMenuItem">
|
||||
<Border Name="BorderRoot" Background="{TemplateBinding Background}">
|
||||
<controls:SimplePanel>
|
||||
<Rectangle Width="4" Fill="{TemplateBinding BorderBrush}" HorizontalAlignment="Left"/>
|
||||
<ContentControl Margin="4,0,0,0">
|
||||
<DockPanel Margin="{TemplateBinding Padding}">
|
||||
<ContentControl Width="40" Name="PresenterIcon">
|
||||
<ContentPresenter ContentSource="Icon" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ContentControl>
|
||||
<ContentPresenter Name="PresenterHeader" ContentSource="Header" Margin="6,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
|
||||
</DockPanel>
|
||||
</ContentControl>
|
||||
</controls:SimplePanel>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="PresenterIcon" Property="Visibility" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<DataTrigger Binding="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=controls:SideMenuItem}}" Value="True">
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
</DataTrigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
<Setter Property="TextElement.FontWeight" Value="Bold" TargetName="PresenterHeader"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="true">
|
||||
<Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SideMenuItemHeaderBaseStyle" TargetType="controls:SideMenuItem">
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource SideMenuItemBaseStyle}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:SideMenuItem">
|
||||
<Border Name="BorderRoot" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="48"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Name="BorderBack" Background="{TemplateBinding Background}"/>
|
||||
<ContentControl Grid.Row="0" Margin="4,0,0,0">
|
||||
<DockPanel Margin="{TemplateBinding Padding}" Name="PanelHeader" Background="Transparent">
|
||||
<ContentControl Width="40" Name="PresenterIcon">
|
||||
<ContentPresenter ContentSource="Icon" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ContentControl>
|
||||
<ContentPresenter Name="PresenterHeader" ContentSource="Header" Margin="6,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
|
||||
</DockPanel>
|
||||
</ContentControl>
|
||||
<StackPanel Grid.Row="1" x:Name="PART_Panel" Visibility="Collapsed" Height="{Binding PanelAreaLength,RelativeSource={RelativeSource AncestorType=controls:SideMenu}}"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="PresenterIcon" Property="Visibility" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="BorderBack" Property="BorderThickness" Value="4,0,0,0"/>
|
||||
<Setter TargetName="BorderBack" Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="TextElement.FontWeight" Value="Bold" TargetName="PresenterHeader"/>
|
||||
</Trigger>
|
||||
<Trigger SourceName="PanelHeader" Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="BorderBack" Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SideMenuItemHeaderAccordionBaseStyle" BasedOn="{StaticResource SideMenuItemHeaderBaseStyle}" TargetType="controls:SideMenuItem">
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource SideMenuItemAccordionBaseStyle}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:SideMenuItem">
|
||||
<Border Name="BorderRoot" Background="{TemplateBinding Background}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition MinHeight="48"/>
|
||||
<RowDefinition/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Name="BorderBack" Background="{TemplateBinding Background}"/>
|
||||
<ContentControl Grid.Row="0" Margin="4,0,0,0">
|
||||
<DockPanel Margin="{TemplateBinding Padding}" Name="PanelHeader" Background="Transparent">
|
||||
<ContentControl Width="40" Name="PresenterIcon">
|
||||
<ContentPresenter ContentSource="Icon" HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
</ContentControl>
|
||||
<ContentPresenter Name="PresenterHeader" ContentSource="Header" Margin="6,0,0,0" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
|
||||
</DockPanel>
|
||||
</ContentControl>
|
||||
<ScrollViewer Visibility="{Binding Visibility,ElementName=PART_Panel}" Grid.Row="1" Height="{Binding PanelAreaLength,RelativeSource={RelativeSource AncestorType=controls:SideMenu}}">
|
||||
<StackPanel x:Name="PART_Panel" Visibility="Collapsed"/>
|
||||
</ScrollViewer>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="PresenterIcon" Property="Visibility" Value="Collapsed"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="BorderBack" Property="BorderThickness" Value="4,0,0,0"/>
|
||||
<Setter TargetName="BorderBack" Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="TextElement.FontWeight" Value="Bold" TargetName="PresenterHeader"/>
|
||||
</Trigger>
|
||||
<Trigger SourceName="PanelHeader" Property="IsMouseOver" Value="true">
|
||||
<Setter TargetName="BorderBack" Property="Background" Value="{DynamicResource SecondaryRegionBrush}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SideMenuBaseStyle" TargetType="controls:SideMenu">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource SideMenuItemHeaderBaseStyle}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:SideMenu">
|
||||
<Border Name="BorderRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<ScrollViewer>
|
||||
<StackPanel x:Name="PART_Panel"/>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,6 +1,7 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||
xmlns:tools="clr-namespace:HandyControl.Tools">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="../Basic/Geometries.xaml"/>
|
||||
@@ -232,6 +233,7 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="Language" Value="{Binding Lang,Source={x:Static tools:ConfigHelper.Instance}}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
<Setter Property="CalendarDayButtonStyle" Value="{StaticResource CalendarDayButtonStyle}"/>
|
||||
<Setter Property="CalendarButtonStyle" Value="{StaticResource CalendarButtonStyle}"/>
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Base/SideMenuBaseStyle.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style BasedOn="{StaticResource SideMenuBaseStyle}" TargetType="controls:SideMenu"/>
|
||||
|
||||
<Style x:Key="SideMenuAccordion" BasedOn="{StaticResource SideMenuBaseStyle}" TargetType="controls:SideMenu">
|
||||
<Setter Property="ExpandMode" Value="Accordion"/>
|
||||
<Setter Property="PanelAreaLength" Value="200"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource SideMenuItemHeaderAccordionBaseStyle}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:SideMenu">
|
||||
<Border Name="BorderRoot" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
|
||||
<StackPanel x:Name="PART_Panel"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -62,6 +62,7 @@
|
||||
<ResourceDictionary Source="Gravatar.xaml"/>
|
||||
<ResourceDictionary Source="Badge.xaml"/>
|
||||
<ResourceDictionary Source="Dialog.xaml"/>
|
||||
<ResourceDictionary Source="SideMenu.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -0,0 +1,69 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
#if !netle40
|
||||
using System.Runtime.CompilerServices;
|
||||
#endif
|
||||
using System.Windows;
|
||||
using System.Windows.Markup;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
public class ConfigHelper : INotifyPropertyChanged
|
||||
{
|
||||
private ConfigHelper()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public static ConfigHelper Instance = new Lazy<ConfigHelper>(() => new ConfigHelper()).Value;
|
||||
|
||||
private XmlLanguage _lang = XmlLanguage.GetLanguage("zh-cn");
|
||||
|
||||
public XmlLanguage Lang
|
||||
{
|
||||
get => _lang;
|
||||
set
|
||||
{
|
||||
if (!_lang.IetfLanguageTag.Equals(value.IetfLanguageTag))
|
||||
{
|
||||
_lang = value;
|
||||
OnPropertyChanged(nameof(Lang));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void SetSystemVersionInfo(SystemVersionInfo info)
|
||||
{
|
||||
BlurWindow.SystemVersionInfo = info;
|
||||
}
|
||||
|
||||
public void SetLang(string lang)
|
||||
{
|
||||
Application.Current.Dispatcher.Thread.CurrentUICulture = new CultureInfo(lang);
|
||||
Lang = XmlLanguage.GetLanguage(lang);
|
||||
}
|
||||
|
||||
public void SetConfig(HandyControlConfig config)
|
||||
{
|
||||
SetSystemVersionInfo(config.SystemVersionInfo);
|
||||
SetLang(config.Lang);
|
||||
}
|
||||
|
||||
public event PropertyChangedEventHandler PropertyChanged;
|
||||
|
||||
#if netle40
|
||||
protected virtual void OnPropertyChanged(string propertyName)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
#else
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||