about summary refs log tree commit diff
path: root/MatrixRoomUtils.Desktop/MainWindow.axaml.cs
diff options
context:
space:
mode:
authorEmma@Rory& <root@rory.gay>2023-07-24 20:57:23 +0200
committerEmma@Rory& <root@rory.gay>2023-07-24 20:57:23 +0200
commitcf6f87bea88df3f90e33dfdc5bb16f47b8716054 (patch)
tree92605891ae683d91f1d71a725d1c94f6675be43b /MatrixRoomUtils.Desktop/MainWindow.axaml.cs
parentDebug validation api (diff)
downloadMatrixUtils-cf6f87bea88df3f90e33dfdc5bb16f47b8716054.tar.xz
Start of MRU Desktop
Diffstat (limited to 'MatrixRoomUtils.Desktop/MainWindow.axaml.cs')
-rw-r--r--MatrixRoomUtils.Desktop/MainWindow.axaml.cs41
1 files changed, 41 insertions, 0 deletions
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<MainWindow> _logger; + private readonly MRUStorageWrapper _storageWrapper; + private readonly MRUDesktopConfiguration _configuration; + + public MainWindow(ILogger<MainWindow> logger, IServiceScopeFactory scopeFactory) { + _logger = logger; + _configuration = scopeFactory.CreateScope().ServiceProvider.GetRequiredService<MRUDesktopConfiguration>(); + _storageWrapper = scopeFactory.CreateScope().ServiceProvider.GetRequiredService<MRUStorageWrapper>(); + _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"); + // } +}