From a664cfbcadd99e350d53c24f8186d8c8e6587427 Mon Sep 17 00:00:00 2001 From: Robert Date: Sun, 27 Mar 2022 12:05:53 +0200 Subject: [PATCH] About tab - Clean up XAML and fix image quality --- .../Device/DeviceSettingsView.axaml.cs | 3 +- .../Screens/Settings/Tabs/AboutTabView.axaml | 106 ++++++++---------- src/Artemis.UI/ViewLocator.cs | 3 +- 3 files changed, 51 insertions(+), 61 deletions(-) diff --git a/src/Artemis.UI/Screens/Device/DeviceSettingsView.axaml.cs b/src/Artemis.UI/Screens/Device/DeviceSettingsView.axaml.cs index 2f10695a3..489ccc822 100644 --- a/src/Artemis.UI/Screens/Device/DeviceSettingsView.axaml.cs +++ b/src/Artemis.UI/Screens/Device/DeviceSettingsView.axaml.cs @@ -1,9 +1,10 @@ using Avalonia.Controls; using Avalonia.Markup.Xaml; +using Avalonia.ReactiveUI; namespace Artemis.UI.Screens.Device { - public partial class DeviceSettingsView : UserControl + public partial class DeviceSettingsView : ReactiveUserControl { public DeviceSettingsView() { diff --git a/src/Artemis.UI/Screens/Settings/Tabs/AboutTabView.axaml b/src/Artemis.UI/Screens/Settings/Tabs/AboutTabView.axaml index b88470250..6afa75db1 100644 --- a/src/Artemis.UI/Screens/Settings/Tabs/AboutTabView.axaml +++ b/src/Artemis.UI/Screens/Settings/Tabs/AboutTabView.axaml @@ -57,7 +57,7 @@ Margin="0 0 15 0" IsVisible="{Binding RobertProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> - + @@ -75,16 +75,7 @@ - - - - - - - - - - + - + @@ -122,7 +113,7 @@ Margin="0 0 15 0" IsVisible="{Binding DrMeteorProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> - + @@ -150,7 +141,7 @@ Margin="0 0 15 0" IsVisible="{Binding KaiProfileImage, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"> - + @@ -198,72 +189,69 @@ - + - Avalonia - FluentAvalonia - EmbedIO - Furl.Http - Humanizer - LiteDB - McMaster.NETCore.Plugins - Newtonsoft.Json - Ninject - RGB.NET - Serilog - SkiaSharp - Unclassified.NetRevisionTask - + Avalonia + FluentAvalonia + EmbedIO + Furl.Http + Humanizer + LiteDB + McMaster.NETCore.Plugins + Newtonsoft.Json + Ninject + RGB.NET + Serilog + SkiaSharp + Unclassified.NetRevisionTask + - https://avaloniaui.net/ - + https://avaloniaui.net/ + - https://github.com/amwx/FluentAvalonia - + https://github.com/amwx/FluentAvalonia + https://unosquare.github.io/embedio/ - https://flurl.dev/ - + https://flurl.dev/ + - https://github.com/Humanizr/Humanizer - + https://github.com/Humanizr/Humanizer + - https://www.litedb.org/ - + https://www.litedb.org/ + - https://github.com/natemcmaster/DotNetCorePlugins - + https://github.com/natemcmaster/DotNetCorePlugins + - https://www.newtonsoft.com/json - + https://www.newtonsoft.com/json + - http://www.ninject.org/ - + http://www.ninject.org/ + - https://github.com/DarthAffe/RGB.NET - + https://github.com/DarthAffe/RGB.NET + - https://serilog.net/ - + https://serilog.net/ + - https://github.com/mono/SkiaSharp - + https://github.com/mono/SkiaSharp + - https://unclassified.software/en/apps/netrevisiontask - + https://unclassified.software/en/apps/netrevisiontask + - - + - - diff --git a/src/Artemis.UI/ViewLocator.cs b/src/Artemis.UI/ViewLocator.cs index 09a87cddc..45ceec2d2 100644 --- a/src/Artemis.UI/ViewLocator.cs +++ b/src/Artemis.UI/ViewLocator.cs @@ -1,4 +1,5 @@ using System; +using System.Diagnostics; using Artemis.Core; using Artemis.UI.Exceptions; using Avalonia.Controls; @@ -18,7 +19,7 @@ public class ViewLocator : IDataTemplate // This isn't strictly required but it's super confusing (and happens to me all the time) if you implement IActivatableViewModel but forget to make your user control reactive. // When this happens your OnActivated never gets called and it's easy to miss. - if (data is IActivatableViewModel && type != null && !type.IsOfGenericType(typeof(ReactiveUserControl<>))) + if (Debugger.IsAttached && data is IActivatableViewModel && type != null && !type.IsOfGenericType(typeof(ReactiveUserControl<>))) throw new ArtemisUIException($"The views of activatable view models should inherit ReactiveUserControl, in this case ReactiveUserControl<{data.GetType().Name}>."); if (type != null)