Files
NebulaLauncher/Nebula.Launcher/Views/MainWindow.axaml.cs

45 lines
1.1 KiB
C#
Raw Normal View History

2025-01-23 20:43:52 +03:00
using Avalonia;
2024-12-18 12:37:00 +03:00
using Avalonia.Controls;
2025-02-02 10:57:29 +03:00
using Avalonia.Input;
using Avalonia.Interactivity;
2024-12-18 12:37:00 +03:00
namespace Nebula.Launcher.Views;
public partial class MainWindow : Window
{
2024-12-21 13:11:30 +03:00
// This constructor is used when the view is created by the XAML Previewer
2024-12-18 12:37:00 +03:00
public MainWindow()
{
InitializeComponent();
}
2024-12-21 13:11:30 +03:00
// This constructor is used when the view is created via dependency injection
public MainWindow(MainView mainView)
: this()
{
2025-02-02 10:57:29 +03:00
Control.Content = mainView;
2025-01-23 20:43:52 +03:00
#if DEBUG
this.AttachDevTools();
#endif
2024-12-21 13:11:30 +03:00
}
2025-02-02 10:57:29 +03:00
private void Minimize_Click(object? sender, RoutedEventArgs e)
{
WindowState = WindowState.Minimized;
}
private void Maximize_Click(object? sender, RoutedEventArgs e)
{
WindowState = WindowState == WindowState.Maximized ? WindowState.Normal : WindowState.Maximized;
}
private void Close_Click(object? sender, RoutedEventArgs e)
{
Close();
}
private void InputElement_OnPointerPressed(object? sender, PointerPressedEventArgs e)
{
BeginMoveDrag(e);
}
2024-12-18 12:37:00 +03:00
}