From 4f9b77d56757650f416c933ddd1f866c8e0f0b49 Mon Sep 17 00:00:00 2001
From: NaBian <836904362@qq.com>
Date: Thu, 19 Nov 2020 23:40:47 +0800
Subject: [PATCH] delete tagpanel
---
.../UserControl/Controls/TagDemoCtl.xaml | 24 +++++++++---------
.../UserControl/Controls/TagDemoCtl.xaml.cs | 18 ++++++-------
.../Controls/Tag/TagContainer.cs | 22 ++++++++++++++++
.../HandyControl_Shared.projitems | 1 +
.../Themes/Styles/Base/TagBaseStyle.xaml | 25 +++++++++++++++++++
.../Themes/Styles/Tag.xaml | 2 ++
6 files changed, 71 insertions(+), 21 deletions(-)
create mode 100644 src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml
index e6cb2880..7926ed2d 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml
@@ -6,17 +6,17 @@
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension"
xmlns:hc="https://handyorg.github.io/handycontrol">
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml.cs
index f3251b74..60662402 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml.cs
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/TagDemoCtl.xaml.cs
@@ -11,14 +11,14 @@ namespace HandyControlDemo.UserControl
InitializeComponent();
}
- private void TagPanel_OnAddTagButtonClick(object sender, EventArgs e)
- {
- if (sender is TagPanel panel)
- {
- var tag = new Tag();
- LangProvider.SetLang(tag, ContentProperty, LangKeys.SubTitle);
- panel.Children.Add(tag);
- }
- }
+ //private void TagPanel_OnAddTagButtonClick(object sender, EventArgs e)
+ //{
+ // if (sender is TagPanel panel)
+ // {
+ // var tag = new Tag();
+ // LangProvider.SetLang(tag, ContentProperty, LangKeys.SubTitle);
+ // panel.Children.Add(tag);
+ // }
+ //}
}
}
diff --git a/src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs b/src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs
new file mode 100644
index 00000000..2d1ea37b
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Controls/Tag/TagContainer.cs
@@ -0,0 +1,22 @@
+using System.Windows;
+using System.Windows.Controls;
+using HandyControl.Data;
+
+namespace HandyControl.Controls
+{
+ public class TagContainer : ItemsControl
+ {
+ public static readonly DependencyProperty IsToolBarVisibleProperty = DependencyProperty.Register(
+ "IsToolBarVisible", typeof(bool), typeof(TagContainer), new PropertyMetadata(ValueBoxes.FalseBox));
+
+ public bool IsToolBarVisible
+ {
+ get => (bool) GetValue(IsToolBarVisibleProperty);
+ set => SetValue(IsToolBarVisibleProperty, value);
+ }
+
+ protected override DependencyObject GetContainerForItemOverride() => new Tag();
+
+ protected override bool IsItemItsOwnContainerOverride(object item) => item is Tag;
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index e92e18b9..758248d4 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -72,6 +72,7 @@
+
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TagBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TagBaseStyle.xaml
index 192f5573..3694716d 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Base/TagBaseStyle.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/TagBaseStyle.xaml
@@ -77,4 +77,29 @@
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Tag.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Tag.xaml
index 8de82ac7..75595a29 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Tag.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Tag.xaml
@@ -8,4 +8,6 @@
+
+
\ No newline at end of file