How can I access a resource when it's declared as a Class in C# back end?

前端 未结 1 1721
情深已故
情深已故 2021-01-24 11:21

My main resources look like this:




        
相关标签:
1条回答
  • 2021-01-24 11:53

    You can use the TryGetValue to obtain a single from your ResourceDictionary:

    if (Application.Current.Resources.TryGetValue("DetailLabel", out object style))
    {
        someLabel.Style = (Style)style;
    }
    
    0 讨论(0)
提交回复
热议问题