Source

main / Source / Excel / Excel.AddIn / Excel.AddIn / View / AlertMessage.xaml.cs

using System;
using System.Windows;
using System.Windows.Input;

namespace DataUp.Excel.Addin
{
    /// <summary>
    /// Interaction logic for AlertMessage.xaml
    /// </summary>
    public partial class AlertMessage : Window
    {
        public bool IsCancelButtonClicked
        {
            get;
            set;
        }

        public AlertViewModel Model
        {
            get
            {
                return this.DataContext as AlertViewModel;
            }
            set
            {
                this.DataContext = value;
            }
        }
        public AlertMessage()
        {
            InitializeComponent();
        }

        internal void OnRequestClose(object sender, EventArgs e)
        {
            this.DialogResult = true;
            IsCancelButtonClicked = false;
        }

        internal void OnIgnore(object sender, EventArgs e)
        {
            this.DialogResult = false;
            IsCancelButtonClicked = false;
        }

        internal void OnCancel(object sender, EventArgs e)
        {
            this.DialogResult = false;
            IsCancelButtonClicked = true;
        }

        private void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            this.DragMove();
        }
    }
}