add HatchBrushGenerator

This commit is contained in:
NaBian committed 2019-09-23 00:20:53 +08:00
1 parent 3d5e5a4306
commit 994c9e642f
25 files changed
+382 -42

No files matched your search

@@ -2,7 +2,9 @@
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using HandyControl.Data;
using HandyControl.Tools;
using HandyControl.Tools.Extension;
@@ -28,7 +30,8 @@ namespace HandyControlDemo.UserControl
private void TabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count == 0) return;
if (e.AddedItems[0] is TabItem tabItem && tabItem.Content is ListBox listBox)
if (e.AddedItems[0] is TabItem tabItem &&
VisualHelper.GetChild<ListBox>(tabItem.Content as DependencyObject) is ListBox listBox)
{
if (listBox.SelectedItem != null)
{
@@ -39,27 +42,18 @@ namespace HandyControlDemo.UserControl
}
}
private void ButtonStyleAscending_OnClick(object sender, RoutedEventArgs e)
private void ButtonAscending_OnClick(object sender, RoutedEventArgs e)
{
if (ButtonStyleAscending.IsChecked == true)
if (sender is ToggleButton button && button.Tag is ItemsControl itemsControl)
{
ListBoxStyle.Items.SortDescriptions.Add(new SortDescription("Content", ListSortDirection.Ascending));
}
else
{
ListBoxStyle.Items.SortDescriptions.Clear();
}
}
private void ButtonControlAscending_OnClick(object sender, RoutedEventArgs e)
{
if (ButtonControlAscending.IsChecked == true)
{
ListBoxControl.Items.SortDescriptions.Add(new SortDescription("Content", ListSortDirection.Ascending));
}
else
{
ListBoxControl.Items.SortDescriptions.Clear();
if (button.IsChecked == true)
{
itemsControl.Items.SortDescriptions.Add(new SortDescription("Content", ListSortDirection.Ascending));
}
else
{
itemsControl.Items.SortDescriptions.Clear();
}
}
}