add #400
This commit is contained in:
1 parent
4bdaa5676e
commit
2d9b6bb8ad
17 files changed
+178
-63
No files matched your search
@@ -0,0 +1,11 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.GeometryDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:TransitioningContentControl>
|
||||
<WrapPanel Name="panel"/>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
using HandyControl.Data;
|
||||
using System;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Shapes;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class GeometryDemoCtl
|
||||
{
|
||||
public GeometryDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
GenerateGeometries();
|
||||
}
|
||||
|
||||
public void GenerateGeometries()
|
||||
{
|
||||
ResourceDictionary dictionary = new ResourceDictionary();
|
||||
dictionary.Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Basic/Geometries.xaml", UriKind.Absolute);
|
||||
foreach (var item in dictionary.Keys)
|
||||
{
|
||||
StackPanel stack = new StackPanel { Margin = new Thickness(10) };
|
||||
TextBlock text = new TextBlock { Text = item.ToString(), HorizontalAlignment = HorizontalAlignment.Stretch };
|
||||
Path path = new Path { Width = 26, Height = 26, Data = TryFindResource(item.ToString()) as Geometry, Fill = TryFindResource(ResourceToken.PrimaryTextBrush) as Brush };
|
||||
stack.Children.Add(path);
|
||||
stack.Children.Add(text);
|
||||
panel.Children.Add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user