MessageBox revision and more async loading
This commit is contained in:
parent
a5d225dc44
commit
61a529e62b
10 changed files with 141 additions and 103 deletions
|
|
@ -8,6 +8,7 @@ using Avalonia.Threading;
|
|||
using LibationWinForms.AvaloniaUI.Views.ProductsGrid;
|
||||
using Avalonia.ReactiveUI;
|
||||
using LibationWinForms.AvaloniaUI.ViewModels;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace LibationWinForms.AvaloniaUI.Views
|
||||
{
|
||||
|
|
@ -21,7 +22,6 @@ namespace LibationWinForms.AvaloniaUI.Views
|
|||
#endif
|
||||
this.FindAllControls();
|
||||
|
||||
|
||||
// eg: if one of these init'd productsGrid, then another can't reliably subscribe to it
|
||||
Configure_BackupCounts();
|
||||
Configure_ScanAuto();
|
||||
|
|
@ -38,11 +38,21 @@ namespace LibationWinForms.AvaloniaUI.Views
|
|||
// misc which belongs in winforms app but doesn't have a UI element
|
||||
Configure_NonUI();
|
||||
|
||||
async void DoDisplay(object _, EventArgs __)
|
||||
{
|
||||
this.Load += (_, _) => productsDisplay.Display();
|
||||
LibraryCommands.LibrarySizeChanged += (_, __) => Dispatcher.UIThread.Post(() => productsDisplay.Display());
|
||||
await productsDisplay.Display();
|
||||
}
|
||||
{
|
||||
this.Load += DoDisplay;
|
||||
LibraryCommands.LibrarySizeChanged += DoDisplay;
|
||||
}
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public event EventHandler Load;
|
||||
|
||||
public void OnLoad() => Load?.Invoke(this, EventArgs.Empty);
|
||||
|
|
@ -114,10 +124,5 @@ namespace LibationWinForms.AvaloniaUI.Views
|
|||
{
|
||||
base.OnDataContextChanged(e);
|
||||
}
|
||||
|
||||
private void InitializeComponent()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue