diff options
Diffstat (limited to 'Erable/Views')
| -rw-r--r-- | Erable/Views/About.axaml | 17 | ||||
| -rw-r--r-- | Erable/Views/About.axaml.cs | 30 | ||||
| -rw-r--r-- | Erable/Views/MainWindow.axaml | 7 | ||||
| -rw-r--r-- | Erable/Views/MainWindow.axaml.cs | 9 |
4 files changed, 59 insertions, 4 deletions
diff --git a/Erable/Views/About.axaml b/Erable/Views/About.axaml new file mode 100644 index 0000000..7d6017f --- /dev/null +++ b/Erable/Views/About.axaml @@ -0,0 +1,17 @@ +<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"
+ mc:Ignorable="d" d:DesignWidth="600" d:DesignHeight="150"
+ x:Class="Erable.Views.About"
+ Width="600"
+ Height="150"
+ Icon="/Assets/erable.png"
+ Title="About Erable">
+ <StackPanel Margin="10">
+ <TextBlock HorizontalAlignment="Center" FontSize="30">About Erable 0.1 Pre-Alpha</TextBlock>
+ <TextBlock HorizontalAlignment="Center" FontSize="20">© Copyright 2021, Alee Productions</TextBlock>
+ <TextBlock HorizontalAlignment="Center" FontSize="20">Licensed with GPL-3.0</TextBlock>
+ <TextBlock HorizontalAlignment="Center" FontSize="20">Report Bugs at https://git.io/JtrAO</TextBlock>
+ </StackPanel>
+</Window>
diff --git a/Erable/Views/About.axaml.cs b/Erable/Views/About.axaml.cs new file mode 100644 index 0000000..d3d2846 --- /dev/null +++ b/Erable/Views/About.axaml.cs @@ -0,0 +1,30 @@ +using System;
+using Avalonia;
+using Avalonia.Controls;
+using Avalonia.Input;
+using Avalonia.Markup.Xaml;
+
+namespace Erable.Views
+{
+ public class About : Window
+ {
+
+ public About()
+ {
+ InitializeComponent();
+#if DEBUG
+ this.AttachDevTools();
+#endif
+ }
+
+ private void InitializeComponent()
+ {
+ AvaloniaXamlLoader.Load(this);
+ }
+
+ private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
+ {
+ Environment.Exit(0);
+ }
+ }
+}
\ No newline at end of file diff --git a/Erable/Views/MainWindow.axaml b/Erable/Views/MainWindow.axaml index de6c5b7..ca78244 100644 --- a/Erable/Views/MainWindow.axaml +++ b/Erable/Views/MainWindow.axaml @@ -19,17 +19,18 @@ <MenuItem Header="_File">
<MenuItem Header="_Open..."/>
<Separator/>
- <MenuItem Header="_Exit" PointerPressed="InputElement_OnPointerPressed"/>
+ <MenuItem Header="_Exit" PointerPressed="Exit_OnPointerPressed"/>
</MenuItem>
<MenuItem Header="_Help">
- <MenuItem Header="_About"/>
+ <MenuItem Header="_About" PointerPressed="About_OnPointerPressed"/>
</MenuItem>
</Menu>
</DockPanel>
<Button Name="PlayButton" Width="80" Command="{Binding PlayFunction}" >Play</Button>
<Button Name="StopButton" Width="80" Command="{Binding StopFunction}">Stop</Button>
<Button Name="BrowseButton" Width="80" Command="{Binding BrowseFunction }" >Browse</Button>
- <!--<Button Name="MessageBoxTest" Width="80" Command="{Binding MsgBoxTest }" >Message Box Test</Button>-->
+ <Button Name="ExceptionButton" Width="80" Command="{Binding ExceptionButton}">Exception</Button>
+ <Button Name="MessageBoxTest" Width="80" Command="{Binding MsgBoxTest }" >Message Box Test</Button>
<Slider Name="AudioSlider"/>
</StackPanel>
</Window>
diff --git a/Erable/Views/MainWindow.axaml.cs b/Erable/Views/MainWindow.axaml.cs index 78cde38..f849f26 100644 --- a/Erable/Views/MainWindow.axaml.cs +++ b/Erable/Views/MainWindow.axaml.cs @@ -21,9 +21,16 @@ namespace Erable.Views AvaloniaXamlLoader.Load(this);
}
- private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
+ private void Exit_OnPointerPressed(object? sender, PointerPressedEventArgs e)
{
Environment.Exit(0);
}
+
+ private void About_OnPointerPressed(object? sender, PointerPressedEventArgs e)
+ {
+ About about = new();
+ about.ShowDialog(this);
+
+ }
}
}
\ No newline at end of file |
