diff --git a/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml b/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml
index e0812ec..c773b8d 100644
--- a/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml
+++ b/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml
@@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="MatrixRoomUtils.Desktop.NavigationStack">
+ x:Class="MatrixRoomUtils.Desktop.Components.NavigationStack">
<DockPanel x:Name="dock">
<StackPanel x:Name="navPanel"></StackPanel>
<UserControl x:Name="content"></UserControl>
diff --git a/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml.cs b/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml.cs
index f4e0fed..d6343e2 100644
--- a/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml.cs
+++ b/MatrixRoomUtils.Desktop/Components/NavigationStack.axaml.cs
@@ -1,8 +1,7 @@
-using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
-namespace MatrixRoomUtils.Desktop;
+namespace MatrixRoomUtils.Desktop.Components;
public partial class NavigationStack : UserControl {
public NavigationStack() {
@@ -20,7 +19,7 @@ public partial class NavigationStack : UserControl {
Button btn = new() {
Content = item.Name
};
- btn.Click += (sender, args) => {
+ btn.Click += (_, _) => {
PopTo(_stack.IndexOf(item));
buildView();
};
@@ -41,7 +40,7 @@ public partial class NavigationStack : UserControl {
public NavigationStackItem? Current => _stack.LastOrDefault();
public void Push(string name, UserControl view) {
- _stack.Add(new NavigationStackItem() {
+ _stack.Add(new NavigationStackItem {
Name = name,
View = view
});
diff --git a/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml b/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml
index c80ef2f..09fe52b 100644
--- a/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml
+++ b/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml
@@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="250" d:DesignHeight="32"
- x:Class="MatrixRoomUtils.Desktop.RoomListEntry">
+ x:Class="MatrixRoomUtils.Desktop.Components.RoomListEntry">
<StackPanel Orientation="Horizontal">
<Image MaxWidth="64" x:Name="RoomIcon"></Image>
<Label x:Name="RoomName"></Label>
diff --git a/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs b/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs
index f29db63..359deb3 100644
--- a/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs
+++ b/MatrixRoomUtils.Desktop/Components/RoomListEntry.axaml.cs
@@ -5,10 +5,9 @@ using LibMatrix;
using LibMatrix.Helpers;
using LibMatrix.Services;
using LibMatrix.StateEventTypes.Spec;
-using MatrixRoomUtils.Web.Classes;
using Microsoft.Extensions.DependencyInjection;
-namespace MatrixRoomUtils.Desktop;
+namespace MatrixRoomUtils.Desktop.Components;
public partial class RoomListEntry : UserControl {
private readonly IServiceScopeFactory _serviceScopeFactory;
@@ -29,7 +28,7 @@ public partial class RoomListEntry : UserControl {
private async Task GetRoomName() {
try {
var nameEvent = await _roomInfo.GetStateEvent("m.room.name");
- if (nameEvent is not null && nameEvent.TypedContent is RoomNameEventData nameData)
+ if (nameEvent?.TypedContent is RoomNameEventData nameData)
RoomName.Content = nameData.Name;
}
catch (MatrixException e) {
@@ -41,7 +40,7 @@ public partial class RoomListEntry : UserControl {
private async Task GetRoomIcon() {
try {
var avatarEvent = await _roomInfo.GetStateEvent("m.room.avatar");
- if (avatarEvent is not null && avatarEvent.TypedContent is RoomAvatarEventData avatarData) {
+ if (avatarEvent?.TypedContent is RoomAvatarEventData avatarData) {
var mxcUrl = avatarData.Url;
await using var svc = _serviceScopeFactory.CreateAsyncScope();
var hs = await svc.ServiceProvider.GetService<MRUStorageWrapper>().GetCurrentSessionOrPrompt();
|