merge pr
This commit is contained in:
1 parent
2d9b6bb8ad
commit
148530b91d
14 files changed
+132
-28
No files matched your search
@@ -412,9 +412,6 @@
|
|||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
||||||
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Geometry_16x.png">
|
|
||||||
<Link>Resources\Img\LeftMainContent\Geometry_16x.png</Link>
|
|
||||||
</Resource>
|
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
||||||
<Link>Resources\fabric-icons.ttf</Link>
|
<Link>Resources\fabric-icons.ttf</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
|||||||
@@ -411,9 +411,6 @@
|
|||||||
</Resource>
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
||||||
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
||||||
</Resource>
|
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Geometry_16x.png">
|
|
||||||
<Link>Resources\Img\LeftMainContent\Geometry_16x.png</Link>
|
|
||||||
</Resource>
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
||||||
<Link>Resources\fabric-icons.ttf</Link>
|
<Link>Resources\fabric-icons.ttf</Link>
|
||||||
|
|||||||
@@ -273,6 +273,9 @@
|
|||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\FrameDemoCtl.xaml">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\FrameDemoCtl.xaml">
|
||||||
<Link>UserControl\Styles\FrameDemoCtl.xaml</Link>
|
<Link>UserControl\Styles\FrameDemoCtl.xaml</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\GeometryDemoCtl.xaml">
|
||||||
|
<Link>UserControl\Styles\GeometryDemoCtl.xaml</Link>
|
||||||
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\GroupBoxDemoCtl.xaml">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\GroupBoxDemoCtl.xaml">
|
||||||
<Link>UserControl\Styles\GroupBoxDemoCtl.xaml</Link>
|
<Link>UserControl\Styles\GroupBoxDemoCtl.xaml</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
@@ -706,6 +709,10 @@
|
|||||||
<Link>UserControl\Styles\FrameDemoCtl.xaml.cs</Link>
|
<Link>UserControl\Styles\FrameDemoCtl.xaml.cs</Link>
|
||||||
<DependentUpon>FrameDemoCtl.xaml</DependentUpon>
|
<DependentUpon>FrameDemoCtl.xaml</DependentUpon>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\GeometryDemoCtl.xaml.cs">
|
||||||
|
<Link>UserControl\Styles\GeometryDemoCtl.xaml.cs</Link>
|
||||||
|
<DependentUpon>GeometryDemoCtl.xaml</DependentUpon>
|
||||||
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\GroupBoxDemoCtl.xaml.cs">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\UserControl\Styles\GroupBoxDemoCtl.xaml.cs">
|
||||||
<Link>UserControl\Styles\GroupBoxDemoCtl.xaml.cs</Link>
|
<Link>UserControl\Styles\GroupBoxDemoCtl.xaml.cs</Link>
|
||||||
<DependentUpon>GroupBoxDemoCtl.xaml</DependentUpon>
|
<DependentUpon>GroupBoxDemoCtl.xaml</DependentUpon>
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
[ "Label", "LabelDemoCtl", "Label_16x", "" ],
|
[ "Label", "LabelDemoCtl", "Label_16x", "" ],
|
||||||
[ "Frame", "FrameDemoCtl", "frame_16xLG", "1" ],
|
[ "Frame", "FrameDemoCtl", "frame_16xLG", "1" ],
|
||||||
[ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "1" ],
|
[ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "1" ],
|
||||||
[ "Geometry", "GeometryDemoCtl", "Geometry_16x", "1" ]
|
[ "Geometry", "GeometryDemoCtl", "Path_16x", "1" ]
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.Data
|
||||||
|
{
|
||||||
|
public class GeometryItemModel
|
||||||
|
{
|
||||||
|
public Geometry Data { get; set; }
|
||||||
|
|
||||||
|
public string Key { get; set; }
|
||||||
|
|
||||||
|
public bool Line { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CardModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CardModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\ChatInfoModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\ChatInfoModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\AvatarModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\AvatarModel.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\GeometryItemModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\PropertyGridDemoModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\PropertyGridDemoModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CoverViewDemoModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\CoverViewDemoModel.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\DemoDataModel.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Data\Model\DemoDataModel.cs" />
|
||||||
@@ -45,6 +46,9 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\ChatBox.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\ChatBox.xaml.cs">
|
||||||
<DependentUpon>ChatBox.xaml</DependentUpon>
|
<DependentUpon>ChatBox.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\GeometryItem.xaml.cs">
|
||||||
|
<DependentUpon>GeometryItem.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\IFull.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\IFull.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\InteractiveDialog.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Basic\InteractiveDialog.xaml.cs">
|
||||||
<DependentUpon>InteractiveDialog.xaml</DependentUpon>
|
<DependentUpon>InteractiveDialog.xaml</DependentUpon>
|
||||||
@@ -316,7 +320,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\FrameDemoCtl.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\FrameDemoCtl.xaml.cs">
|
||||||
<DependentUpon>FrameDemoCtl.xaml</DependentUpon>
|
<DependentUpon>FrameDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\GeometryDemoCtl.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\GeometryDemoCtl.xaml.cs">
|
||||||
<DependentUpon>GeometryDemoCtl.xaml</DependentUpon>
|
<DependentUpon>GeometryDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\GroupBoxDemoCtl.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\GroupBoxDemoCtl.xaml.cs">
|
||||||
@@ -506,6 +510,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="$(MSBuildThisFileDirectory)UserControl\Basic\GeometryItem.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Basic\InteractiveDialog.xaml">
|
<Page Include="$(MSBuildThisFileDirectory)UserControl\Basic\InteractiveDialog.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
@@ -866,7 +874,7 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Styles\GeometryDemoCtl.xaml">
|
<Page Include="$(MSBuildThisFileDirectory)UserControl\Styles\GeometryDemoCtl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -757,6 +757,6 @@
|
|||||||
<value>图片选择器</value>
|
<value>图片选择器</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Geometry" xml:space="preserve">
|
<data name="Geometry" xml:space="preserve">
|
||||||
<value>Geometry</value>
|
<value>几何形状</value>
|
||||||
</data>
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -593,7 +593,11 @@ namespace HandyControlDemo.Properties.Langs
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string Frame => Lang.Frame;
|
public string Frame => Lang.Frame;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 几何形状 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
public string Geometry => Lang.Geometry;
|
public string Geometry => Lang.Geometry;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 Gif图片 的本地化字符串。
|
/// 查找类似 Gif图片 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -1668,6 +1672,9 @@ namespace HandyControlDemo.Properties.Langs
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static string Frame = nameof(Frame);
|
public static string Frame = nameof(Frame);
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 几何形状 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
public static string Geometry = nameof(Geometry);
|
public static string Geometry = nameof(Geometry);
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 470 B |
@@ -187,4 +187,20 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="Path4GeometryItem" BasedOn="{StaticResource {x:Type Path}}" TargetType="Path">
|
||||||
|
<Setter Property="Margin" Value="10"/>
|
||||||
|
<Setter Property="Data" Value="{Binding Info.Data,RelativeSource={RelativeSource AncestorType=Border}}"/>
|
||||||
|
<Setter Property="Fill" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
|
<Setter Property="Width" Value="20"/>
|
||||||
|
<Setter Property="Height" Value="20"/>
|
||||||
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Style.Triggers>
|
||||||
|
<DataTrigger Binding="{Binding Info.Line,RelativeSource={RelativeSource AncestorType=Border}}" Value="True">
|
||||||
|
<Setter Property="Fill" Value="{x:Null}"/>
|
||||||
|
<Setter Property="Stroke" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
|
</DataTrigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
<Border x:Class="HandyControlDemo.UserControl.GeometryItem"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
|
Margin="16"
|
||||||
|
Cursor="Hand"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
Style="{StaticResource BorderCircular}" Background="{DynamicResource RegionBrush}" ToolTip="{Binding Info.Key,RelativeSource={RelativeSource Self}}">
|
||||||
|
<Path Style="{StaticResource Path4GeometryItem}"/>
|
||||||
|
</Border>
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using HandyControlDemo.Data;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.UserControl
|
||||||
|
{
|
||||||
|
public partial class GeometryItem
|
||||||
|
{
|
||||||
|
public GeometryItem() => InitializeComponent();
|
||||||
|
|
||||||
|
public static readonly DependencyProperty InfoProperty = DependencyProperty.Register(
|
||||||
|
"Info", typeof(GeometryItemModel), typeof(GeometryItem), new PropertyMetadata(default(GeometryItemModel)));
|
||||||
|
|
||||||
|
public GeometryItemModel Info
|
||||||
|
{
|
||||||
|
get => (GeometryItemModel) GetValue(InfoProperty);
|
||||||
|
set => SetValue(InfoProperty, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -2,10 +2,27 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
|
||||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||||
Background="{DynamicResource RegionBrush}">
|
Background="{DynamicResource RegionBrush}">
|
||||||
<hc:TransitioningContentControl>
|
<hc:TransitioningContentControl>
|
||||||
<WrapPanel Name="panel"/>
|
<ListBox Effect="{StaticResource EffectShadow2}" Margin="32" BorderThickness="0" Style="{StaticResource ListBoxCustom}" Background="Transparent" ItemsSource="{Binding GeometryItems}">
|
||||||
|
<ListBox.ItemsPanel>
|
||||||
|
<ItemsPanelTemplate>
|
||||||
|
<hc:HoneycombPanel>
|
||||||
|
<hc:HoneycombPanel.RenderTransform>
|
||||||
|
<TransformGroup>
|
||||||
|
<TranslateTransform X="-32"/>
|
||||||
|
</TransformGroup>
|
||||||
|
</hc:HoneycombPanel.RenderTransform>
|
||||||
|
</hc:HoneycombPanel>
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
<ListBox.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<userControl:GeometryItem Info="{Binding}"/>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListBox.ItemTemplate>
|
||||||
|
</ListBox>
|
||||||
</hc:TransitioningContentControl>
|
</hc:TransitioningContentControl>
|
||||||
</UserControl>
|
</UserControl>
|
||||||
@@ -1,15 +1,24 @@
|
|||||||
|
using System;
|
||||||
using HandyControl.Data;
|
using System.Collections.Generic;
|
||||||
using System;
|
using System.Collections.ObjectModel;
|
||||||
using System.Windows;
|
using System.Linq;
|
||||||
using System.Windows.Controls;
|
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Shapes;
|
using HandyControl.Themes;
|
||||||
|
using HandyControl.Tools;
|
||||||
|
using HandyControlDemo.Data;
|
||||||
|
|
||||||
namespace HandyControlDemo.UserControl
|
namespace HandyControlDemo.UserControl
|
||||||
{
|
{
|
||||||
public partial class GeometryDemoCtl
|
public partial class GeometryDemoCtl
|
||||||
{
|
{
|
||||||
|
private readonly HashSet<string> _lineSet = new HashSet<string>
|
||||||
|
{
|
||||||
|
"CheckedGeometry"
|
||||||
|
};
|
||||||
|
|
||||||
|
public ObservableCollection<GeometryItemModel> GeometryItems { get; set; } =
|
||||||
|
new ObservableCollection<GeometryItemModel>();
|
||||||
|
|
||||||
public GeometryDemoCtl()
|
public GeometryDemoCtl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
@@ -18,16 +27,19 @@ namespace HandyControlDemo.UserControl
|
|||||||
|
|
||||||
public void GenerateGeometries()
|
public void GenerateGeometries()
|
||||||
{
|
{
|
||||||
ResourceDictionary dictionary = new ResourceDictionary();
|
var uri = new Uri("pack://application:,,,/HandyControl;component/Themes/Basic/Geometries.xaml", UriKind.Absolute);
|
||||||
dictionary.Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Basic/Geometries.xaml", UriKind.Absolute);
|
var dic = SharedResourceDictionary.SharedDictionaries[uri];
|
||||||
foreach (var item in dictionary.Keys)
|
var keys = dic.Keys.OfType<string>().OrderBy(item => item);
|
||||||
|
|
||||||
|
foreach (var key in keys)
|
||||||
{
|
{
|
||||||
StackPanel stack = new StackPanel { Margin = new Thickness(10) };
|
var data = ResourceHelper.GetResource<Geometry>(key);
|
||||||
TextBlock text = new TextBlock { Text = item.ToString(), HorizontalAlignment = HorizontalAlignment.Stretch };
|
GeometryItems.Add(new GeometryItemModel
|
||||||
Path path = new Path { Width = 26, Height = 26, Data = TryFindResource(item.ToString()) as Geometry, Fill = TryFindResource(ResourceToken.PrimaryTextBrush) as Brush };
|
{
|
||||||
stack.Children.Add(path);
|
Key = key,
|
||||||
stack.Children.Add(text);
|
Data = data,
|
||||||
panel.Children.Add(stack);
|
Line = _lineSet.Contains(key)
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user