コード例 #1
0
        private void ChromelessWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
        {
            object        frameContent = Navigator.Frame.Content;
            PDFViewerPage page         = frameContent as PDFViewerPage;
            ViewModel     viewModel    = null;

            if (page != null)
            {
                page.Unload();
                viewModel = page.DataContext as ViewModel;
                page      = null;
            }
            else
            {
                FrontPage frontPage = frameContent as FrontPage;
                viewModel = frontPage.DataContext as ViewModel;
                frontPage = null;
            }
            if (viewModel != null)
            {
                viewModel.Dispose();
            }
            Navigator.Frame = null;
        }