c# - WPF Control Templating - How do I create a custom property? -
i'm building xaml usercontrol library using blend.
i've created template custom wpf slider type. i'd able add custom brush property control allow easy customisation when designing application interface (my slider design has background colour, foreground colour , thumbnail colour). possible, , if so, appear in blend interface?
i know create load of styles, seems overkill changing single colour...
in codebehind of usercontrol, define dependency properties brushes want use in template.
public static readonly dependencyproperty thumbnailbrushproperty = dependencyproperty.register("command", typeof (brush), typeof (yourcontrol), new propertymetadata(default(brush)));
this property show in vs designer , blend in miscellaneous section.
if understand right, have created controltemplate
custom slider control. if so, can use property within template binding via template binding:
update
ok, creating template standard slider control. have considered defining brushes use thumbnailbrush
etc. in resource, reference resource dictionary in resource dictionary holds slider template , use them within template? in blend able modify in resources tab.
Comments
Post a Comment