Exemple #1
0
        private void OnWindowClosing(object sender, CancelEventArgs e)
        {
            if (m_ButtonTriggersClose)
            {
                ContentPlaceHolder.Content = null;
                DetailsPlaceHolder.Content = null;

                if (m_whenDoneAction != null)
                {
                    m_whenDoneAction.Invoke();
                    m_whenDoneAction = null;
                }

                return;
            }

            if (!AllowEscapeAndCloseButton)
            {
                AudioCues.PlayAsterisk();
                e.Cancel = true;
                return;
            }

            ContentPlaceHolder.Content = null;
            DetailsPlaceHolder.Content = null;

            if (m_whenDoneAction != null)
            {
                m_whenDoneAction.Invoke();
                m_whenDoneAction = null;
            }
        }
Exemple #2
0
 protected override void OnKeyUp(KeyEventArgs e)
 {
     if (!IgnoreEscape && e.Key == Key.Escape)
     {
         if (AllowEscapeAndCloseButton)
         {
             m_ButtonTriggersClose = false;
             Close();
         }
         else
         {
             AudioCues.PlayAsterisk();
         }
     }
     base.OnKeyUp(e);
 }