Hai guys
I extended markupextention class to set the background property of controlls my code is
public class OwnStyleExtension : MarkupExtension
{
public static System.Windows.Media.BrushConverter bc = new System.Windows.Media.BrushConverter();
public static Brush brush = (Brush)bc.ConvertFrom("#00FFFF");
public static Brush BagCol
{
get
{
return brush;
}
set
{
brush = value;
}
}
public override object ProvideValue(IServiceProvider serviceProvider)
{
return BagCol;
}
}
and my xaml code is
<Button Name="Btn2" Background="{local:OwnStyle}" Margin="0,105,0,122"></Button>
again i set the BagCol property in code for button click event as
BrushConverter bc = new BrushConverter();
Brush mybrush = (Brush)bc.ConvertFrom("#00FF00");
OwnStyleExtension.BagCol = mybrush;
The problem is, even it changes the BagCol property value it doesn't changes backgroundcolor in the button...
Can you anyone suggest me, how can i overcome this problem.
Thanks Jsiva