Minor refactor

This commit is contained in:
Michael Bucari-Tovo 2022-07-14 02:46:45 -06:00
parent 7b28a274a8
commit a5d225dc44
4 changed files with 8 additions and 10 deletions

View File

@ -43,7 +43,7 @@ namespace LibationWinForms.AvaloniaUI.Views
Tag = quickFilterTag,
Header = $"_{++index}: {filter}"
};
quickFilterMenuItem.Click += (_, __) => performFilter(filter);
quickFilterMenuItem.Click += async (_, __) => await performFilter(filter);
allItems.Add(quickFilterMenuItem);
}
quickFiltersToolStripMenuItem.Items = allItems;
@ -60,10 +60,10 @@ namespace LibationWinForms.AvaloniaUI.Views
public void editQuickFiltersToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e) => new EditQuickFilters().ShowDialog();
public void productsDisplay_Initialized(object sender, EventArgs e)
public async void productsDisplay_Initialized(object sender, EventArgs e)
{
if (QuickFilters.UseDefault)
performFilter(QuickFilters.Filters.FirstOrDefault());
await performFilter(QuickFilters.Filters.FirstOrDefault());
}
}
}

View File

@ -20,7 +20,7 @@ namespace LibationWinForms.AvaloniaUI.Views
await productsDisplay.RemoveCheckedBooksAsync();
}
public void doneRemovingBtn_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
public async void doneRemovingBtn_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
{
removeBooksBtn.IsVisible = false;
doneRemovingBtn.IsVisible = false;
@ -30,7 +30,7 @@ namespace LibationWinForms.AvaloniaUI.Views
//Restore the filter
filterSearchTb.IsEnabled = true;
filterSearchTb.IsVisible = true;
performFilter(filterSearchTb.Text);
await performFilter(filterSearchTb.Text);
}
public void removeLibraryBooksToolStripMenuItem_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)

View File

@ -20,8 +20,6 @@ namespace LibationWinForms
[return: System.Runtime.InteropServices.MarshalAs(System.Runtime.InteropServices.UnmanagedType.Bool)]
static extern bool AllocConsole();
static bool UseAvaloniaUI = true;
[STAThread]
static async Task Main()
{
@ -39,12 +37,11 @@ namespace LibationWinForms
if (!startupTask.Result.success)
return;
//When RunStartupStuff completes, check if user has opted into beta and run Avalonia UI if they did.
//Otherwise we just ignore all the Avalonia app build stuff and continue with winforms.
//For debug purposes, always run AvaloniaUI.
if (true) // (startupTask.Result.useBeta)
if (true)// (startupTask.Result.useBeta)
{
await Task.WhenAll(appBuilderTask, classicLifetimeTask, startupTask);
@ -121,7 +118,7 @@ namespace LibationWinForms
// global exception handling (ShowAdminAlert) attempts to use logging. only call it after logging has been init'd
postLoggingGlobalExceptionHandling();
return (true, !useBeta);
return (true, useBeta);
}
private static void RunInstaller(Configuration config)

View File

@ -12,5 +12,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>false</SelfContained>
<PublishSingleFile>false</PublishSingleFile>
<PublishReadyToRun>true</PublishReadyToRun>
</PropertyGroup>
</Project>