mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
add selected songs count display
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Specialized;
|
||||
using System.Threading.Tasks;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Styling;
|
||||
using Avalonia.Threading;
|
||||
using MercuryConverter.Data;
|
||||
using MercuryConverter.UI.Dialogs;
|
||||
using MercuryConverter.UI.Views;
|
||||
|
||||
@@ -30,6 +32,9 @@ public partial class MainWindow : Window
|
||||
|
||||
// Show dialog on startup
|
||||
Activated += OnActivated;
|
||||
|
||||
Selection.selections.CollectionChanged += OnDbSelChanged;
|
||||
Database.Songs.CollectionChanged += OnDbSelChanged;
|
||||
}
|
||||
|
||||
private void OnActivated(object? sender, EventArgs e)
|
||||
@@ -41,6 +46,14 @@ public partial class MainWindow : Window
|
||||
Dialog.IsOpen = true;
|
||||
}
|
||||
|
||||
private void OnDbSelChanged(object? sender, NotifyCollectionChangedEventArgs e)
|
||||
{
|
||||
if (Database.Songs.Count > 0)
|
||||
{
|
||||
TabSelection.Header = $"selection ({Selection.selections.Count}/{Database.Songs.Count})";
|
||||
}
|
||||
}
|
||||
|
||||
public void OpenDataHandler()
|
||||
{
|
||||
Dialog.IsOpen = true;
|
||||
|
||||
Reference in New Issue
Block a user