fix: fix tag input demo.
This commit is contained in:
@@ -5,6 +5,9 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:vm="using:Ursa.Demo.ViewModels"
|
||||
x:DataType="vm:TagInputDemoViewModel"
|
||||
x:CompileBindings="True"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
mc:Ignorable="d">
|
||||
@@ -12,14 +15,14 @@
|
||||
<u:TagInput
|
||||
Name="labels"
|
||||
Margin="20"
|
||||
AllowDuplicates="False"
|
||||
AllowDuplicates="True"
|
||||
Separator="-"
|
||||
Tags="{Binding Tags}" />
|
||||
<u:TagInput
|
||||
Margin="20"
|
||||
AllowDuplicates="False"
|
||||
Separator="-"
|
||||
Tags="{Binding #labels.Tags}" />
|
||||
<ListBox ItemsSource="{Binding #labels.Tags}" />
|
||||
Tags="{Binding DistinctTags}" />
|
||||
<ListBox ItemsSource="{Binding DistinctTags}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -4,10 +4,17 @@ namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class TagInputDemoViewModel: ViewModelBase
|
||||
{
|
||||
private ObservableCollection<string> _Tags ;
|
||||
private ObservableCollection<string> _tags = new () ;
|
||||
public ObservableCollection<string> Tags
|
||||
{
|
||||
get { return _Tags; }
|
||||
set { SetProperty(ref _Tags, value); }
|
||||
get => _tags;
|
||||
set => SetProperty(ref _tags, value);
|
||||
}
|
||||
|
||||
private ObservableCollection<string> _distinctTags = new();
|
||||
public ObservableCollection<string> DistinctTags
|
||||
{
|
||||
get => _distinctTags;
|
||||
set => SetProperty(ref _distinctTags, value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user