mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-05 16:56:34 +08:00
mind
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user