From 6b56d440229609cf88cb7742691d5a017af7dbec Mon Sep 17 00:00:00 2001 From: rabbitism Date: Thu, 4 May 2023 17:11:47 +0800 Subject: [PATCH] feat: add combobox samples. --- samples/ControlCatalog/Pages/ComboBoxPage.xaml | 15 +++++++++++++++ .../ViewModels/ComboBoxPageViewModel.cs | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/samples/ControlCatalog/Pages/ComboBoxPage.xaml b/samples/ControlCatalog/Pages/ComboBoxPage.xaml index 748a46c447..f3f6cfe0af 100644 --- a/samples/ControlCatalog/Pages/ComboBoxPage.xaml +++ b/samples/ControlCatalog/Pages/ComboBoxPage.xaml @@ -98,6 +98,21 @@ Inline Item 3 Inline Item 4 + + + + + + + + + + + + + + + WrapSelection diff --git a/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs b/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs index d3e4ea7c31..6ab7bb02e3 100644 --- a/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs +++ b/samples/ControlCatalog/ViewModels/ComboBoxPageViewModel.cs @@ -16,5 +16,20 @@ namespace ControlCatalog.ViewModels get => _wrapSelection; set => this.RaiseAndSetIfChanged(ref _wrapSelection, value); } + + public ObservableCollection Values { get; set; } = new ObservableCollection + { + new IdAndName(){ Id = "Id 1", Name = "Name 1" }, + new IdAndName(){ Id = "Id 2", Name = "Name 2" }, + new IdAndName(){ Id = "Id 3", Name = "Name 3" }, + new IdAndName(){ Id = "Id 4", Name = "Name 4" }, + new IdAndName(){ Id = "Id 5", Name = "Name 5" }, + }; + } + + public class IdAndName + { + public string Id { get; set; } + public string Name { get; set; } } }