From cf6f87bea88df3f90e33dfdc5bb16f47b8716054 Mon Sep 17 00:00:00 2001 From: "Emma@Rory&" Date: Mon, 24 Jul 2023 20:57:23 +0200 Subject: Start of MRU Desktop --- MatrixRoomUtils.Desktop/MainWindow.axaml.cs | 41 +++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 MatrixRoomUtils.Desktop/MainWindow.axaml.cs (limited to 'MatrixRoomUtils.Desktop/MainWindow.axaml.cs') diff --git a/MatrixRoomUtils.Desktop/MainWindow.axaml.cs b/MatrixRoomUtils.Desktop/MainWindow.axaml.cs new file mode 100644 index 0000000..41e0888 --- /dev/null +++ b/MatrixRoomUtils.Desktop/MainWindow.axaml.cs @@ -0,0 +1,41 @@ +using Avalonia.Controls; +using Avalonia.Interactivity; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +namespace MatrixRoomUtils.Desktop; + +public partial class MainWindow : Window { + private readonly ILogger _logger; + private readonly MRUStorageWrapper _storageWrapper; + private readonly MRUDesktopConfiguration _configuration; + + public MainWindow(ILogger logger, IServiceScopeFactory scopeFactory) { + _logger = logger; + _configuration = scopeFactory.CreateScope().ServiceProvider.GetRequiredService(); + _storageWrapper = scopeFactory.CreateScope().ServiceProvider.GetRequiredService(); + _logger.LogInformation("Initialising MainWindow"); + + InitializeComponent(); + + _logger.LogInformation("Cache location: " + _configuration.CacheStoragePath); + _logger.LogInformation("Data location: " + _configuration.DataStoragePath); + + + for (int i = 0; i < 100; i++) { + roomList.Children.Add(new RoomListEntry()); + } + } + + // ReSharper disable once AsyncVoidMethod + protected override async void OnLoaded(RoutedEventArgs e) { + _logger.LogInformation("async onloaded override"); + var hs = await _storageWrapper.GetCurrentSessionOrPrompt(); + base.OnLoaded(e); + } + + // public Command + // protected void LoadedCommand() { + // _logger.LogInformation("async command"); + // } +} -- cgit 1.5.1