WPF Dynamic Resource

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ThoraD

    #1

    WPF Dynamic Resource

    I am just trying to find out how to do things so
    I have some shapes in generic.xaml and the same shapes in luna.metallic.x aml
    with a different color.
    I can load them as a dynamic resource in xaml using a ComponentResour ceKey
    and they will change color when I change Theme.

    In code I can only load them as static resources.
    ComponentResour ceKey cmykey = new
    ComponentResour ceKey(typeof(Cu stomControl1), "mykeyl");

    Image im1 = new Image();

    im1.SetResource Reference(Image .SourceProperty , "cmykeyl");

    does not work, im1.source is null. Why ? And how do I do it ?

    TIA

    ThoraD



Working...