This commit is contained in:
艾竹
2023-03-18 21:44:58 +08:00
parent d97938cc2b
commit 9b3c2633a7
32 changed files with 3229 additions and 77 deletions

View File

@@ -19,24 +19,21 @@ namespace AIStudio.Wpf.Mind.Controls
/// <summary>
/// TagControl.xaml 的交互逻辑
/// </summary>
public class TagControl : Control
public class TagControl : ItemsControl
{
static TagControl()
{
DefaultStyleKeyProperty.OverrideMetadata(typeof(TagControl), new FrameworkPropertyMetadata(typeof(TagControl)));
}
/// <summary>Identifies the <see cref="Tags"/> dependency property.</summary>
public static readonly DependencyProperty TagsProperty
= DependencyProperty.Register(nameof(Tags), typeof(ObservableCollection<string>), typeof(TagControl));
/// <summary>
/// Whether or not the "popup" menu for this control is currently open
/// </summary>
public ObservableCollection<string> Tags
protected override DependencyObject GetContainerForItemOverride()
{
get => (ObservableCollection<string>)this.GetValue(TagsProperty);
set => this.SetValue(TagsProperty, (ObservableCollection<string>)value);
return new ContentControl();
}
protected override bool IsItemItsOwnContainerOverride(object item)
{
return item is ContentControl;
}
}
}