none
在应用商店中怎么在代码中调用Resources中的Style RRS feed

  • 问题

  • this.Style = (Style)Resources.FirstOrDefault(m=>m.Key=="TextButtonStyle").Value;

    不知道怎么去查找Resources中的Style 

    2013年11月8日 15:22

答案

  • Hi 柯小南,

    想要查找ResourceDictionary中的Style可以通过如下方式

    targetStyle = Application.Current.Resources["targetStyle"] as Style;

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    2013年11月8日 16:16
    版主