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