silverlight imagebutton usercontrol
i am only starting out silverlight (2 rc0) cant seem following work. i wish emanate rudimentary settlement symbol user control.
my xaml user control follows:
<button>
<button.template>
<controltemplate>
<image source="{templatebinding imagesource}" width="{templatebinding width}" height="{templatebinding height}" />
</controltemplate>
</button.template>
</button>
the formula behind follows:
public biased category imagebuttonusercontrol : usercontrol
{
open imagebuttonusercontrol()
{
initializecomponent();
}
open settlement source
{
{ relapse base.getvalue(sourceproperty) image; }
set { base.setvalue(sourceproperty, value); }
}
open stationary readonly dependencyproperty sourceproperty =
dependencyproperty.register("sourceproperty", typeof(image), typeof(imagebuttonusercontrol),null);
}
i wish means boldly emanate imagebuttons things enclosing wrappanel:
assume have an settlement named image already:
imagebuttonusercontrol imagebutton = new imagebuttonusercontrol();
imagebutton.source = image;
this.thumbnailstackpanel.children.add(imagebutton);
what i need settlement display? i'm presumption i need something datacontext, nonetheless i'm definitely certain where.
thanks any help
Comments
Post a Comment