App.xaml file does not get parsed if my app does not set a StartupUri?

后端 未结 4 2069
没有蜡笔的小新
没有蜡笔的小新 2020-11-30 01:07

Background: I\'m creating a WPF app using MVVM, and using a DI container to build my ViewModels

My App.xaml looks like this:



        
4条回答
  •  迷失自我
    2020-11-30 01:28

    To get around this know bug you can also just add resources programmatically.

    var rd = new ResourceDictionary()
    rd.Source = new Uri("pack://application:,,,/Resources;component/Colors.xaml");
    Resources.MergedDictionaries.Add(rd);
    

    This code can be placed inside the construtor for the App class.

提交回复
热议问题