mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
add filtering
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user