sourcegit/src/Views/LauncherPage.axaml.cs

53 lines
1.4 KiB
C#
Raw Normal View History

2024-07-14 09:30:31 -07:00
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
namespace SourceGit.Views
{
public partial class LauncherPage : UserControl
{
public LauncherPage()
{
InitializeComponent();
}
private void OnPopupSure(object _, RoutedEventArgs e)
{
if (DataContext is ViewModels.LauncherPage page)
page.ProcessPopup();
e.Handled = true;
}
private void OnPopupCancel(object _, RoutedEventArgs e)
{
if (DataContext is ViewModels.LauncherPage page)
page.CancelPopup();
e.Handled = true;
}
private void OnMaskClicked(object sender, PointerPressedEventArgs e)
2024-07-14 09:30:31 -07:00
{
OnPopupCancel(sender, e);
}
2024-12-12 18:06:28 -08:00
private void OnCopyNotification(object sender, RoutedEventArgs e)
{
if (sender is Button { DataContext: Models.Notification notice })
App.CopyText(notice.Message);
e.Handled = true;
}
2024-07-14 09:30:31 -07:00
private void OnDismissNotification(object sender, RoutedEventArgs e)
{
if (sender is Button { DataContext: Models.Notification notice } &&
2024-07-14 09:30:31 -07:00
DataContext is ViewModels.LauncherPage page)
page.Notifications.Remove(notice);
e.Handled = true;
}
}
}