- rework: Logging logic and file logging
This commit is contained in:
17
Nebula.Launcher/MessageBox/MessageView.axaml
Normal file
17
Nebula.Launcher/MessageBox/MessageView.axaml
Normal file
@@ -0,0 +1,17 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
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"
|
||||
Width="600"
|
||||
Height="400"
|
||||
x:Class="Nebula.Launcher.MessageBox.MessageView">
|
||||
<Grid RowDefinitions="50,*" ColumnDefinitions="*">
|
||||
<Border Grid.Column="0" Background="#222222" Padding="10" BorderBrush="#444444" BorderThickness="0,0,0,3">
|
||||
<Label VerticalAlignment="Center" x:Name="Title">Text</Label>
|
||||
</Border>
|
||||
<Panel Margin="5" Grid.Row="1">
|
||||
<Label x:Name="Message">Message</Label>
|
||||
</Panel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
25
Nebula.Launcher/MessageBox/MessageView.axaml.cs
Normal file
25
Nebula.Launcher/MessageBox/MessageView.axaml.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
namespace Nebula.Launcher.MessageBox;
|
||||
|
||||
public partial class MessageView : UserControl, IMessageContainerProvider
|
||||
{
|
||||
public MessageView(out IMessageContainerProvider provider)
|
||||
{
|
||||
InitializeComponent();
|
||||
provider = this;
|
||||
}
|
||||
|
||||
public void ShowMessage(string message, string title)
|
||||
{
|
||||
Title.Content = title;
|
||||
Message.Content = message;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IMessageContainerProvider
|
||||
{
|
||||
public void ShowMessage(string message, string title);
|
||||
}
|
||||
12
Nebula.Launcher/MessageBox/MessageWindow.axaml
Normal file
12
Nebula.Launcher/MessageBox/MessageWindow.axaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<Window xmlns="https://github.com/avaloniaui"
|
||||
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"
|
||||
xmlns:messageBox="clr-namespace:Nebula.Launcher.MessageBox"
|
||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
|
||||
Width="600"
|
||||
Height="400"
|
||||
x:Class="Nebula.Launcher.MessageBox.MessageWindow"
|
||||
Title="MessageWindow">
|
||||
|
||||
</Window>
|
||||
12
Nebula.Launcher/MessageBox/MessageWindow.axaml.cs
Normal file
12
Nebula.Launcher/MessageBox/MessageWindow.axaml.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace Nebula.Launcher.MessageBox;
|
||||
|
||||
public partial class MessageWindow : Window
|
||||
{
|
||||
public MessageWindow(out IMessageContainerProvider provider)
|
||||
{
|
||||
InitializeComponent();
|
||||
Content = new MessageView(out provider);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user