mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Layer properties - Added back most of the reworked VMs and views
This commit is contained in:
1 parent
7b238e241e
commit
ea66dcd39e
21 files changed
+862
-146
No files matched your search
@@ -10,29 +10,38 @@
|
||||
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" />
|
||||
|
||||
<StackPanel Orientation="Vertical" HorizontalAlignment="Right" Margin="16">
|
||||
<TextBlock Style="{StaticResource MaterialDesignHeadline6TextBlock}" Text="{Binding Header}"
|
||||
TextWrapping="Wrap" />
|
||||
<Separator Margin="0 15" />
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" FontWeight="Bold" Margin="22 0">Exception message</TextBlock>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" HorizontalAlignment="Left" Text="{Binding Exception.Message}" TextWrapping="Wrap" Margin="22 5" MaxWidth="1000" />
|
||||
<Separator Margin="0 15" />
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Text="Stack trace" TextWrapping="Wrap" FontWeight="Bold" Margin="22 0" />
|
||||
<ScrollViewer MaxHeight="500">
|
||||
<StackPanel>
|
||||
<ItemsControl ItemsSource="{Binding Exceptions}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<StackPanel>
|
||||
<TextBlock Style="{StaticResource MaterialDesignBody1TextBlock}" Text="Stack trace"
|
||||
TextWrapping="Wrap" FontWeight="Bold"/>
|
||||
|
||||
<avalonedit:TextEditor SyntaxHighlighting="C#"
|
||||
FontFamily="pack://application:,,,/Resources/Fonts/#Roboto Mono"
|
||||
FontSize="10pt"
|
||||
IsReadOnly="True"
|
||||
Document="{Binding Document}"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
MaxWidth="1000"
|
||||
Margin="0 10" />
|
||||
<avalonedit:TextEditor SyntaxHighlighting="C#"
|
||||
FontFamily="pack://application:,,,/Resources/Fonts/#Roboto Mono"
|
||||
FontSize="10pt"
|
||||
IsReadOnly="True"
|
||||
Document="{Binding Document}"
|
||||
HorizontalScrollBarVisibility="Auto"
|
||||
VerticalScrollBarVisibility="Auto"
|
||||
MaxWidth="1000"
|
||||
Margin="0 10 10 0"
|
||||
Padding="10"/>
|
||||
|
||||
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0"
|
||||
Command="{s:Action Close}" Content="Close" />
|
||||
</StackPanel>
|
||||
<Separator Margin="0 15" />
|
||||
</StackPanel>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
<Button Style="{StaticResource MaterialDesignFlatButton}" IsDefault="True" Margin="0 8 0 0"
|
||||
Command="{s:Action Close}" Content="Close" HorizontalAlignment="Right" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -1,6 +1,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Artemis.UI.Shared.Services.Dialog;
|
||||
using ICSharpCode.AvalonEdit;
|
||||
using ICSharpCode.AvalonEdit.Document;
|
||||
|
||||
namespace Artemis.UI.Shared.Screens.Dialogs
|
||||
@@ -10,18 +10,35 @@ namespace Artemis.UI.Shared.Screens.Dialogs
|
||||
public ExceptionDialogViewModel(string message, Exception exception)
|
||||
{
|
||||
Header = message;
|
||||
Exception = exception;
|
||||
Document = new TextDocument(new StringTextSource(exception.StackTrace));
|
||||
Exceptions = new List<DialogException>();
|
||||
|
||||
var currentException = exception;
|
||||
while (currentException != null)
|
||||
{
|
||||
Exceptions.Add(new DialogException(currentException));
|
||||
currentException = currentException.InnerException;
|
||||
}
|
||||
}
|
||||
|
||||
public string Header { get; }
|
||||
public Exception Exception { get; }
|
||||
public List<DialogException> Exceptions { get; set; }
|
||||
|
||||
public IDocument Document { get; set; }
|
||||
|
||||
public void Close()
|
||||
{
|
||||
Session.Close();
|
||||
}
|
||||
}
|
||||
|
||||
public class DialogException
|
||||
{
|
||||
public Exception Exception { get; }
|
||||
public IDocument Document { get; set; }
|
||||
|
||||
public DialogException(Exception exception)
|
||||
{
|
||||
Exception = exception;
|
||||
Document = new TextDocument(new StringTextSource($"{exception.Message}\r\n\r\n{exception.StackTrace}"));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user