如何引用 generic.xaml 中出现的默认样式?
我正在尝试创建一个返回自定义控件的已知样式的静态类。我知道如何提取 App.xaml 中存在的样式,但我不确定如何获取通用样式。
public static class VehicleTypes
{
public static readonly Style SportsCar = /*???Default style for VehicleIcon from generic.xaml*/;
public static readonly Style Sedan = Application.Current.Resources["SedanStyle"] as Style;
public static readonly Style Jeep = Application.Current.Resources["JeepStyle"] as Style;
...
}
谢谢!