diff --git a/MainWindow.axaml b/MainWindow.axaml index 12116d1..b437dee 100644 --- a/MainWindow.axaml +++ b/MainWindow.axaml @@ -22,6 +22,7 @@ + @@ -32,6 +33,7 @@ + diff --git a/Views/Selection/Selection.axaml b/Views/Selection/Selection.axaml index c5ff6bd..33cda69 100644 --- a/Views/Selection/Selection.axaml +++ b/Views/Selection/Selection.axaml @@ -6,21 +6,39 @@ x:Class="MercuryConverter.Views.Selection" > - - - - - - - - - - - - + + + + + 12 0 12 15 + 0 0 0 0 + + + + + + + + + + + + + + + + + + + + + + + + - - + + diff --git a/Views/Selection/Selection.axaml.cs b/Views/Selection/Selection.axaml.cs index b801861..7bafac3 100644 --- a/Views/Selection/Selection.axaml.cs +++ b/Views/Selection/Selection.axaml.cs @@ -1,8 +1,11 @@ +using Microsoft.VisualBasic; using System; using System.Collections.ObjectModel; using System.Collections.Specialized; +using System.Threading.Tasks; using Avalonia.Controls; using MercuryConverter.Data; +using Avalonia; namespace MercuryConverter.Views; @@ -13,19 +16,35 @@ public partial class Selection : Panel { InitializeComponent(); ListingTable.SelectionMode = DataGridSelectionMode.Extended; - SourceFilter.ItemsSource = new string[]{ - "", - Consts.NUM_SOURCE[1], - Consts.NUM_SOURCE[2], - Consts.NUM_SOURCE[3], - Consts.NUM_SOURCE[4], - Consts.NUM_SOURCE[5], - }; - + + foreach (var (k, v) in Consts.NUM_SOURCE) + { + FilterSourceContainer.Children.Add( + new CheckBox + { + Name = $"FilterSourceCheckbox{k}", + Content = v, + } + ); + } + foreach (var (k, v) in Consts.CATEGORY_INDEX) + { + if (k == -1) + continue; + + FilterCategoryContainer.Children.Add( + new CheckBox + { + Name = $"FilterCategoryCheckbox{k}", + Content = v, + } + ); + } + SongCollection.CollectionChanged += OnSongsChg; DataContext = this; - // test data + // placeholder data if (SongCollection.Count == 0) { SongCollection.Add(