我已经用
加载了一个资源<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/PresentationFramework.Classic;V4.0.0.0;31bf3856ad364e35;component/themes/classic.xaml" />
</ResourceDictionary.MergedDictionaries>
然后我实例化了一个继承自X
:
Combobox
public class X : ComboBox { }
public class MainWindow : Window {
public MainWindow() {
panel.Children.Add(new X()); // does NOT contain the loaded styles
panel.Children.Add(new Combobox()); // contains the loaded styles
}
}
如何将加载的资源分配给此类X?
由于