mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
UI - Implemented tray icon
UI - Moved dialog service to the shared UI project UI - Implemented autorun
This commit is contained in:
1 parent
b3f6aef101
commit
5710acb321
34 files changed
+344
-57
No files matched your search
@@ -0,0 +1,23 @@
|
||||
<UserControl x:Class="Artemis.UI.Shared.Screens.Dialogs.ConfirmDialogView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:dialogs="clr-namespace:Artemis.UI.Shared.Screens.Dialogs"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="163.274" d:DesignWidth="254.425"
|
||||
d:DataContext="{d:DesignInstance dialogs:ConfirmDialogViewModel}">
|
||||
<StackPanel Margin="16">
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline6TextBlock}" Text="{Binding Header}" TextWrapping="Wrap" />
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 20 0 20" Text="{Binding Text}" TextWrapping="Wrap" />
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsCancel="True" Margin="0 8 8 0"
|
||||
Command="{s:Action Cancel}" Content="{Binding CancelText}" />
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0"
|
||||
Command="{s:Action Confirm}" Content="{Binding ConfirmText}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,30 @@
|
||||
using Artemis.UI.Shared.Services.Dialog;
|
||||
|
||||
namespace Artemis.UI.Shared.Screens.Dialogs
|
||||
{
|
||||
public class ConfirmDialogViewModel : DialogViewModelBase
|
||||
{
|
||||
public ConfirmDialogViewModel(string header, string text, string confirmText, string cancelText)
|
||||
{
|
||||
Header = header;
|
||||
Text = text;
|
||||
ConfirmText = confirmText;
|
||||
CancelText = cancelText;
|
||||
}
|
||||
|
||||
public string Header { get; }
|
||||
public string Text { get; }
|
||||
public string ConfirmText { get; }
|
||||
public string CancelText { get; }
|
||||
|
||||
public void Confirm()
|
||||
{
|
||||
Session.Close(true);
|
||||
}
|
||||
|
||||
public void Cancel()
|
||||
{
|
||||
Session.Close(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<UserControl x:Class="Artemis.UI.Shared.Screens.Dialogs.ExceptionDialogView"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:s="https://github.com/canton7/Stylet"
|
||||
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
|
||||
xmlns:dialogs="clr-namespace:Artemis.UI.Shared.Screens.Dialogs"
|
||||
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="163.274" d:DesignWidth="254.425"
|
||||
d:DataContext="{d:DesignInstance dialogs:ExceptionDialogViewModel}">
|
||||
<StackPanel Margin="16">
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline6TextBlock}" Text="{Binding Header}" TextWrapping="Wrap" />
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Margin="0 20 0 20" Text="{Binding Exception.Message}" TextWrapping="Wrap" />
|
||||
|
||||
<Separator></Separator>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Text="Stack trace" TextWrapping="Wrap" FontWeight="Bold" Margin="20 5 0 0"/>
|
||||
<avalonedit:TextEditor SyntaxHighlighting="C#"
|
||||
FontFamily="Consolas"
|
||||
FontSize="10pt"
|
||||
IsReadOnly="True"
|
||||
Document="{Binding Document}"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
Margin="0 10"/>
|
||||
<Separator></Separator>
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0"
|
||||
Command="{s:Action Close}" Content="Close" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using Artemis.UI.Shared.Services.Dialog;
|
||||
using ICSharpCode.AvalonEdit;
|
||||
using ICSharpCode.AvalonEdit.Document;
|
||||
|
||||
namespace Artemis.UI.Shared.Screens.Dialogs
|
||||
{
|
||||
public class ExceptionDialogViewModel : DialogViewModelBase
|
||||
{
|
||||
public ExceptionDialogViewModel(string message, Exception exception)
|
||||
{
|
||||
Header = message;
|
||||
Exception = exception;
|
||||
Document = new TextDocument(new StringTextSource(exception.StackTrace));
|
||||
}
|
||||
|
||||
public string Header { get; }
|
||||
public Exception Exception { get; }
|
||||
|
||||
public IDocument Document { get; set; }
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Session.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user