You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

62 lines
1.6 KiB

using System.Windows;
using System.Windows.Input;
using System.Windows.Media;
namespace SparkClient.Views.Dialog
{
/// <summary>
/// MsgDialog.xaml 的交互逻辑
/// </summary>
public partial class MsgDialog : Window
{
public MsgDialog()
{
InitializeComponent();
this.Loaded += (s, e) => ApplyCornerRadiusClip();
this.SizeChanged += (s, e) => ApplyCornerRadiusClip();
}
/// <summary>
/// 关闭按钮点击事件
/// </summary>
private void CloseButton_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
/// <summary>
/// 跳过按钮点击事件
/// </summary>
private void Skip_Click(object sender, RoutedEventArgs e)
{
this.Close();
}
/// <summary>
/// 窗口圆角裁剪
/// </summary>
private void ApplyCornerRadiusClip()
{
if (this.ActualWidth > 0 && this.ActualHeight > 0)
{
this.Clip = new RectangleGeometry
{
Rect = new Rect(0, 0, this.ActualWidth, this.ActualHeight),
RadiusX = 20,
RadiusY = 20
};
}
}
/// <summary>
/// 支持窗口拖动
/// </summary>
private void Window_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
if (e.LeftButton == MouseButtonState.Pressed)
{
this.DragMove();
}
}
}
}