첨부 소스 코드는 나눔고딕코딩 폰트를 사용합니다.
728x90
반응형
728x170

TestProject.zip
다운로드

▶ MainApplication.xaml

<Application x:Class="TestProject.MainApplication"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    StartupUri="MainWindow.xaml">
</Application>

 

728x90

 

▶ MainApplication.xaml.cs

using System.Windows;

namespace TestProject
{
    /// <summary>
    /// 메인 애플리케이션
    /// </summary>
    public partial class MainApplication : Application
    {
        //////////////////////////////////////////////////////////////////////////////////////////////////// Method
        ////////////////////////////////////////////////////////////////////////////////////////// Protected

        #region 세션 종료시 처리하기 - OnSessionEnding(e)
        
        /// <summary>
        /// 세션 종료시 처리하기
        /// </summary>
        /// <param name="e">이벤트 인자</param>
        protected override void OnSessionEnding(SessionEndingCancelEventArgs e)
        {
            base.OnSessionEnding(e);
        
            MessageBoxResult result = MessageBox.Show
            (
                "데이터를 저장하시겠습니까?",
                MainWindow.Title,
                MessageBoxButton.YesNoCancel,
                MessageBoxImage.Question,
                MessageBoxResult.Yes
            );
        
            e.Cancel = (result == MessageBoxResult.Cancel);
        }
        
        #endregion
    }
}
728x90
반응형
그리드형(광고전용)
Posted by icodebroker

댓글을 달아 주세요