码迷,mamicode.com
首页 > 移动开发 > 详细

WPF——Application

时间:2019-06-06 15:31:53      阅读:134      评论:0      收藏:0      [点我收藏+]

标签:Locator   ima   程序   yam   space   rgs   reference   shu   net   

Application类处于WPF应用程序的最顶端,main函数就在这个类中。
技术图片
Application类的作用:
截图连接 https://docs.microsoft.com/zh-cn/dotnet/api/system.windows.application?view=netframework-4.8
技术图片
https://docs.microsoft.com/zh-cn/dotnet/framework/wpf/app-development/application-management-overview

#region Assembly PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35
// C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5\PresentationFramework.dll
#endregion

using System.Collections;
using System.Reflection;
using System.Security;
using System.Windows.Markup;
using System.Windows.Navigation;
using System.Windows.Resources;
using System.Windows.Threading;

namespace System.Windows
{
    public class Application : DispatcherObject, IHaveResources, IQueryAmbient
    {        
        [SecurityCritical]
        public Application();

        public static Assembly ResourceAssembly { get; set; }
        public static Application Current { get; }
        public WindowCollection Windows { get; }
        public Window MainWindow { get; set; }
        public ShutdownMode ShutdownMode { get; set; }
        [Ambient]
        public ResourceDictionary Resources { get; set; }
        public Uri StartupUri { get; set; }
        public IDictionary Properties { get; }

        public event StartupEventHandler Startup;
        public event ExitEventHandler Exit;
        public event EventHandler Deactivated;
        public event SessionEndingCancelEventHandler SessionEnding;
        public event DispatcherUnhandledExceptionEventHandler DispatcherUnhandledException;
        public event NavigatingCancelEventHandler Navigating;
        public event NavigatedEventHandler Navigated;
        public event NavigationProgressEventHandler NavigationProgress;
        public event NavigationFailedEventHandler NavigationFailed;
        public event LoadCompletedEventHandler LoadCompleted;
        public event EventHandler Activated;
        public event NavigationStoppedEventHandler NavigationStopped;
        public event FragmentNavigationEventHandler FragmentNavigation;

        [SecurityCritical]
        public static StreamResourceInfo GetContentStream(Uri uriContent);
        public static string GetCookie(Uri uri);
        [SecurityCritical]
        public static StreamResourceInfo GetRemoteStream(Uri uriRemote);
        [SecurityCritical]
        public static StreamResourceInfo GetResourceStream(Uri uriResource);
        public static object LoadComponent(Uri resourceLocator);
        [SecurityCritical]
        public static void LoadComponent(object component, Uri resourceLocator);
        public static void SetCookie(Uri uri, string value);
        public object FindResource(object resourceKey);
        [SecurityCritical]
        public int Run(Window window);
        public int Run();
        public void Shutdown();
        [SecurityCritical]
        public void Shutdown(int exitCode);
        public object TryFindResource(object resourceKey);
        protected virtual void OnActivated(EventArgs e);
        protected virtual void OnDeactivated(EventArgs e);
        protected virtual void OnExit(ExitEventArgs e);
        protected virtual void OnFragmentNavigation(FragmentNavigationEventArgs e);
        protected virtual void OnLoadCompleted(NavigationEventArgs e);
        protected virtual void OnNavigated(NavigationEventArgs e);
        protected virtual void OnNavigating(NavigatingCancelEventArgs e);
        protected virtual void OnNavigationFailed(NavigationFailedEventArgs e);
        protected virtual void OnNavigationProgress(NavigationProgressEventArgs e);
        protected virtual void OnNavigationStopped(NavigationEventArgs e);
        protected virtual void OnSessionEnding(SessionEndingCancelEventArgs e);
        protected virtual void OnStartup(StartupEventArgs e);
    }
}

在xml文件中指定启动的Page或者Windows就可启动窗体。
技术图片

WPF——Application

标签:Locator   ima   程序   yam   space   rgs   reference   shu   net   

原文地址:https://www.cnblogs.com/feipeng8848/p/10985026.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!