⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 applicationshellapplication.cs

📁 wpf和cab的结合使用源码(转载)
💻 CS
字号:
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
using System.Windows;

namespace Microsoft.Practices.CompositeUI.Windows
{
	/// <summary>
	/// Extends <see cref="WindowsApplication{TWorkItem, TShell}"/> to support WPF applications that use a WPF <see cref="Application"/>
	/// instance as their shell.
	/// </summary>
	/// <typeparam name="TWorkItem">
	/// The work item type.
	/// </typeparam>
	/// <typeparam name="TShell">
	/// The shell type.
	/// </typeparam>
	public abstract class ApplicationShellApplication<TWorkItem, TShell> : WindowsApplication<TWorkItem, TShell>
		where TWorkItem : WorkItem, new()
		where TShell : Application, new()
	{
		protected override void AfterShellCreated()
		{
			base.AfterShellCreated();

			//have to initialize the app - no way other than reflection?
			MethodInfo initializeMethod = typeof(TShell).GetMethod("InitializeComponent", BindingFlags.Public | BindingFlags.Instance);

			if (initializeMethod != null)
			{
				initializeMethod.Invoke(Shell, null);
			}
		}

		protected override void Start()
		{
			Shell.Run();
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -