How to preload XAML at app startup?

后端 未结 2 1664
夕颜
夕颜 2021-02-10 10:27

I have pretty large UserControl that\'s not showed at main screen, but user almost always uses it later. It takes some time to load for the first time (parse BAML etc.) then oth

2条回答
  •  一向
    一向 (楼主)
    2021-02-10 11:22

    You could use the App ctor or Startup

        App()
        {
            System.Diagnostics.Debug.WriteLine("App ctor");
            //ctor
        }
    
        private void Application_Startup(object sender, StartupEventArgs e)
        {
            System.Diagnostics.Debug.WriteLine("App Startup");
        }
    

提交回复
热议问题