diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml index ef2e0da..97e0876 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml +++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml @@ -4,22 +4,30 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:local="clr-namespace:Semi.Avalonia.Demo.Pages" d:DesignHeight="450" d:DesignWidth="800" mc:Ignorable="d"> - - Item 1 - Item 2 - Item 3 - Item 4 - Item 5 - Item 6 - Item 7 - Item 8 - Item 9 - Item 10 - Item 11 - Item 12 - Item 13 - - + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs index 6d5c3e7..14734e0 100644 --- a/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs +++ b/demo/Semi.Avalonia.Demo/Pages/ListBoxDemo.axaml.cs @@ -1,6 +1,6 @@ -using Avalonia; +using System.Collections; +using System.Collections.Generic; using Avalonia.Controls; -using Avalonia.Markup.Xaml; namespace Semi.Avalonia.Demo.Pages; @@ -10,4 +10,19 @@ public partial class ListBoxDemo : UserControl { InitializeComponent(); } + + public IEnumerable Items { get; set; } = new List + { + new() { Name = "Ding", IsAvailable = true }, + new() { Name = "Otter", IsAvailable = true }, + new() { Name = "Husky", IsAvailable = false }, + new() { Name = "Mr.17", IsAvailable = true }, + new() { Name = "Cass", IsAvailable = true }, + }; +} + +internal record Panda +{ + public string Name { get; set; } + public bool IsAvailable { get; set; } } \ No newline at end of file diff --git a/src/Semi.Avalonia/Controls/ListBox.axaml b/src/Semi.Avalonia/Controls/ListBox.axaml index f07d864..5ba9a52 100644 --- a/src/Semi.Avalonia/Controls/ListBox.axaml +++ b/src/Semi.Avalonia/Controls/ListBox.axaml @@ -66,7 +66,8 @@ @@ -84,8 +85,187 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file