c# - UserControl Property binding issues -
i have view integrate usercontrol several times.... text gets binded , propertychanged occurs. good. borderbrush never changes.. shiftid , boxname null.
i'm not sure i'm missing out here.. been playing around , reading stuff day now. no solution yet.
some suggestions helpful.
i not sure how instantiate borderbrush property me did work this:
public brush borderbrush { { return (brush)getvalue(borderbrushproperty); } set { setvalue(borderbrushproperty, value); } } // using dependencyproperty backing store borderbrush. enables animation, styling, binding, etc... public static readonly dependencyproperty borderbrushproperty = dependencyproperty.register("borderbrush", typeof(brush), typeof(mainwindow), new propertymetadata(null));
this instantiation takes place after initializecomponent:
borderbrush = new solidcolorbrush(colors.green);
and @ point have button click handler change it:
(borderbrush solidcolorbrush).color = colors.red;
i not sure if aims target didn't see instantiation , thought might solution..
Comments
Post a Comment