WPF Window Style not working at runtime

前端 未结 2 1405
情书的邮戳
情书的邮戳 2021-01-02 07:28

I created a WPF application in Visual Studio 2010 Express (C#) and added the text below to the Application.Resources in App.xaml. I see the style applied to the window in th

2条回答
  •  醉酒成梦
    2021-01-02 07:57

    I have the same problem. We developed a library with custom styles for every standart control, it works fine under .net 3.5 both at deigner and at runtime. Today we decided to switch our projects to .net4 (wpf 4 has many new tasty feautures). After that at runtime all styles like this not working at runtime, but applying at designer:

     
    

    Styles with setted x:Key working fine. But we need to set default style for a theme, not to set it for each control.

提交回复
热议问题