Source

main-vinayFork / Source / Excel / Excel.AddIn / Excel.AddIn / View / GenerateCitationViewPane.xaml.cs

Full commit
using System;
using System.Windows;
using System.Windows.Input;

namespace DataUp.Excel.Addin
{
    /// <summary>
    /// Interaction logic for GenerateCitationViewPane.xaml
    /// </summary>
    public partial class GenerateCitationViewPane : Window
    {
        public GenerateCitationPaneViewModel Model
        {
            get
            {
                return this.DataContext as GenerateCitationPaneViewModel;
            }
            set
            {
                this.DataContext = value;
            }
        }

        public GenerateCitationViewPane()
        {
            InitializeComponent();
        }

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

        private void OnKeyDown(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Escape)
            {
                if (this.Model != null && this.Model.ShowIdentifier)
                {
                    this.Model.ShowIdentifier = false;
                }
                else
                {
                    this.Close();
                }
            }
        }

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