Port Form1 to Avalonia
This commit is contained in:
parent
ef869dbe09
commit
0de62ce010
58 changed files with 4408 additions and 17 deletions
|
|
@ -0,0 +1,48 @@
|
|||
using ApplicationServices;
|
||||
using Avalonia.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LibationWinForms.AvaloniaUI.Views
|
||||
{
|
||||
//DONE
|
||||
public partial class MainWindow
|
||||
{
|
||||
private void Configure_ScanNotification()
|
||||
{
|
||||
scanningToolStripMenuItem.IsVisible = false;
|
||||
LibraryCommands.ScanBegin += LibraryCommands_ScanBegin;
|
||||
LibraryCommands.ScanEnd += LibraryCommands_ScanEnd;
|
||||
}
|
||||
private void LibraryCommands_ScanBegin(object sender, int accountsLength)
|
||||
{
|
||||
removeLibraryBooksToolStripMenuItem.IsEnabled = false;
|
||||
removeAllAccountsToolStripMenuItem.IsEnabled = false;
|
||||
removeSomeAccountsToolStripMenuItem.IsEnabled = false;
|
||||
scanLibraryToolStripMenuItem.IsEnabled = false;
|
||||
scanLibraryOfAllAccountsToolStripMenuItem.IsEnabled = false;
|
||||
scanLibraryOfSomeAccountsToolStripMenuItem.IsEnabled = false;
|
||||
|
||||
this.scanningToolStripMenuItem.IsVisible = true;
|
||||
this.scanningToolStripMenuItem_Text.Text
|
||||
= (accountsLength == 1)
|
||||
? "Scanning..."
|
||||
: $"Scanning {accountsLength} accounts...";
|
||||
}
|
||||
|
||||
private void LibraryCommands_ScanEnd(object sender, EventArgs e)
|
||||
{
|
||||
removeLibraryBooksToolStripMenuItem.IsEnabled = true;
|
||||
removeAllAccountsToolStripMenuItem.IsEnabled = true;
|
||||
removeSomeAccountsToolStripMenuItem.IsEnabled = true;
|
||||
scanLibraryToolStripMenuItem.IsEnabled = true;
|
||||
scanLibraryOfAllAccountsToolStripMenuItem.IsEnabled = true;
|
||||
scanLibraryOfSomeAccountsToolStripMenuItem.IsEnabled = true;
|
||||
|
||||
this.scanningToolStripMenuItem.IsVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue