From 0830532e7ecd8a73599d0560ffeffce441ce995a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matija=20Ko=C5=BEelj?= Date: Wed, 15 Mar 2023 10:35:41 +0100 Subject: [PATCH] Add dropdown demo page for implementation testing --- .../Pages/DropdownDemo.razor | 18 ++++++++++++ .../Pages/DropdownDemo.razor.cs | 29 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor create mode 100644 src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor.cs diff --git a/src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor b/src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor new file mode 100644 index 0000000..c06ae02 --- /dev/null +++ b/src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor @@ -0,0 +1,18 @@ +@page "/demo/components/dropdown" + +@namespace Connected.Components.Showcase.Runner + +@using Connected.Components; + + e.Value.ToString()) @bind-SelectedItems="@SelectedItems" AllowMultiple=true> + + @context.Name + + + @context.Name + + + +
+ @string.Join(", ", SelectedItems.Select(e=> e.Value)) +
diff --git a/src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor.cs b/src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor.cs new file mode 100644 index 0000000..75f36ad --- /dev/null +++ b/src/Connected.Components.Showcase.Runner/Pages/DropdownDemo.razor.cs @@ -0,0 +1,29 @@ +using System.Collections.ObjectModel; + +namespace Connected.Components.Showcase.Runner; + +public partial class DropdownDemo +{ + private ObservableCollection SelectedItems { get; set; } = new(); + + private ObservableCollection Items { get; set; } = new ObservableCollection + { + new TestObject + { + Name= "Simple", + Value = 1 + }, + new TestObject + { + Name = "Simpler", + Value = 2 + } + }; + + public class TestObject + { + public string Name { get; set; } + + public long Value { get; set; } + } +} \ No newline at end of file