Fail to do binding Template Property
-
I wrote some Template to button object in my xaml. I want to have image on the button - so i wrote a Template ( code attached ) I want to bind the image source to some variable in the xaml code ( in the c# code ) and i dont know how to do it.
<Style x:Key="MyBtnTmpl" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="SomePath.png" Stretch="Fill"/> </ControlTemplate> </Setter.Value> </Setter> </Style>
-
I wrote some Template to button object in my xaml. I want to have image on the button - so i wrote a Template ( code attached ) I want to bind the image source to some variable in the xaml code ( in the c# code ) and i dont know how to do it.
<Style x:Key="MyBtnTmpl" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Image Source="SomePath.png" Stretch="Fill"/> </ControlTemplate> </Setter.Value> </Setter> </Style>