Files
Wand-Enhancer-luanslimadev/WeModPatcher/View/MainWindow/MainWindow.xaml.cs
T
2025-03-21 23:35:16 +02:00

49 lines
1.2 KiB
C#

using System;
using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
namespace WeModPatcher.View.MainWindow
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow
{
public static MainWindow Instance;
public MainWindow()
{
InitializeComponent();
this.DataContext = new MainWindowVm();
Instance = this;
}
public void OpenPopup(object content, string title = null)
{
this.PopupHost.PopupContent = content;
PopupHost.Title.Text = title;
PopupHost.IsOpen = true;
}
private void OnDragMove(object sender, MouseButtonEventArgs e)
{
this.DragMove();
}
private void OnClosing(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
public void ClosePopup()
{
PopupHost.IsOpen = false;
}
private void OpenSourceClicked(object sender, MouseButtonEventArgs e)
{
System.Diagnostics.Process.Start(Constants.RepositoryUrl);
}
}
}