diff --git a/src/Artemis.UI.Avalonia.Shared/Artemis.UI.Avalonia.Shared.xml b/src/Artemis.UI.Avalonia.Shared/Artemis.UI.Avalonia.Shared.xml
index 569228685..96cbdbc6e 100644
--- a/src/Artemis.UI.Avalonia.Shared/Artemis.UI.Avalonia.Shared.xml
+++ b/src/Artemis.UI.Avalonia.Shared/Artemis.UI.Avalonia.Shared.xml
@@ -455,17 +455,17 @@
- Represents the base class for Artemis view models
+ Represents the base class for Artemis view models
- Gets or sets the display name of the view model
+ Gets or sets the display name of the view model
- Represents the base class for Artemis view models that are interested in the activated event
+ Represents the base class for Artemis view models that are interested in the activated event
@@ -473,11 +473,11 @@
- Releases the unmanaged resources used by the object and optionally releases the managed resources.
+ Releases the unmanaged resources used by the object and optionally releases the managed resources.
- to release both managed and unmanaged resources;
- to release only unmanaged resources.
+ to release both managed and unmanaged resources;
+ to release only unmanaged resources.
@@ -488,20 +488,18 @@
- Represents the base class for Artemis view models used to drive dialogs
+ Represents the base class for Artemis view models used to drive dialogs
-
-
-
-
+
- Closes the dialog with a given result
+ Closes the dialog with the given
+ The result of the dialog
-
+
- Closes the dialog without a result
+ Closes the dialog without a result
diff --git a/src/Artemis.UI.Avalonia.Shared/Events/DialogClosedEventArgs.cs b/src/Artemis.UI.Avalonia.Shared/Events/DialogClosedEventArgs.cs
new file mode 100644
index 000000000..0a5aa0755
--- /dev/null
+++ b/src/Artemis.UI.Avalonia.Shared/Events/DialogClosedEventArgs.cs
@@ -0,0 +1,14 @@
+using System;
+
+namespace Artemis.UI.Avalonia.Shared.Events
+{
+ internal class DialogClosedEventArgs : EventArgs
+ {
+ public TResult Result { get; }
+
+ public DialogClosedEventArgs(TResult result)
+ {
+ Result = result;
+ }
+ }
+}
diff --git a/src/Artemis.UI.Avalonia.Shared/Services/Builders/NotificationBuilder.cs b/src/Artemis.UI.Avalonia.Shared/Services/Builders/NotificationBuilder.cs
index 7cd562f7c..ebfbddbff 100644
--- a/src/Artemis.UI.Avalonia.Shared/Services/Builders/NotificationBuilder.cs
+++ b/src/Artemis.UI.Avalonia.Shared/Services/Builders/NotificationBuilder.cs
@@ -1,6 +1,7 @@
using System;
using System.Threading.Tasks;
using Avalonia.Controls;
+using Avalonia.Layout;
using Avalonia.Threading;
using FluentAvalonia.UI.Controls;
using ReactiveUI;
@@ -17,7 +18,12 @@ namespace Artemis.UI.Avalonia.Shared.Services.Builders
public NotificationBuilder(Window parent)
{
_parent = parent;
- _infoBar = new InfoBar {Classes = Classes.Parse("notification-info-bar")};
+ _infoBar = new InfoBar
+ {
+ Classes = Classes.Parse("notification-info-bar"),
+ VerticalAlignment = VerticalAlignment.Bottom,
+ HorizontalAlignment = HorizontalAlignment.Right
+ };
}
public NotificationBuilder WithTitle(string? title)
@@ -38,6 +44,17 @@ namespace Artemis.UI.Avalonia.Shared.Services.Builders
return this;
}
+ public NotificationBuilder WithVerticalPosition(VerticalAlignment position)
+ {
+ _infoBar.VerticalAlignment = position;
+ return this;
+ }
+
+ public NotificationBuilder WithHorizontalPosition(HorizontalAlignment position)
+ {
+ _infoBar.HorizontalAlignment = position;
+ return this;
+ }
///
/// Add a filter to the dialog
@@ -105,8 +122,8 @@ namespace Artemis.UI.Avalonia.Shared.Services.Builders
public IControl Build()
{
- return _action != null
- ? new Button {Content = _text, Command = ReactiveCommand.Create(() => _action)}
+ return _action != null
+ ? new Button {Content = _text, Command = ReactiveCommand.Create(() => _action)}
: new Button {Content = _text};
}
}
diff --git a/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml b/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml
index 0fc655a38..8211265bb 100644
--- a/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml
+++ b/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml
@@ -2,8 +2,47 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
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"
+ mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="800"
x:Class="Artemis.UI.Avalonia.Shared.Services.ExceptionDialogView"
- Title="ExceptionDialogView">
- Eh you got an exception but I didn't write the viewer yet :(
-
+ Title="{Binding Title}"
+ ExtendClientAreaToDecorationsHint="True"
+ Width="800"
+ Height="800"
+ WindowStartupLocation="CenterOwner">
+
+
+
+
+
+
+
+ Awww :(
+
+ It looks like Artemis ran into an unhandled exception. If this keeps happening feel free to hit us up on Discord.
+
+
+
+
+
+
+
+
+ When reporting errors please don't take a screenshot of the error, instead copy the text, thanks!
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml.cs b/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml.cs
index 773c3f6d7..9af31290c 100644
--- a/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml.cs
+++ b/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogView.axaml.cs
@@ -4,7 +4,7 @@ using Avalonia.ReactiveUI;
namespace Artemis.UI.Avalonia.Shared.Services
{
- public partial class ExceptionDialogView : ReactiveWindow
+ internal class ExceptionDialogView : ReactiveWindow
{
public ExceptionDialogView()
{
@@ -19,4 +19,4 @@ namespace Artemis.UI.Avalonia.Shared.Services
AvaloniaXamlLoader.Load(this);
}
}
-}
+}
\ No newline at end of file
diff --git a/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogViewModel.cs b/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogViewModel.cs
index a43a2c1f4..66fb9bdeb 100644
--- a/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogViewModel.cs
+++ b/src/Artemis.UI.Avalonia.Shared/Services/WindowService/ExceptionDialogViewModel.cs
@@ -1,12 +1,35 @@
using System;
+using System.Threading.Tasks;
+using Artemis.UI.Avalonia.Shared.Services.Builders;
+using Artemis.UI.Avalonia.Shared.Services.Interfaces;
+using Avalonia;
+using Avalonia.Layout;
namespace Artemis.UI.Avalonia.Shared.Services
{
- public class ExceptionDialogViewModel : DialogViewModelBase