WPF/Silverlight : Templating Custom Control PARTIALLY -
.
hello guys,
can write our custom controls in such way later on can re-template partially? means, without replacing entire controltemplate, want change/override some of it's , feel?
one way, of course, : copy controltemplate code generic.xaml, modify it's , feel partially, , use in xaml, shown below:
<mycustomcontrol> <mycustomcontrol.template> <controltemplate> <!-- paste copied , modified code generic.xaml here--> </controltemplate> </mycustomcontrol.template> <!--other code--> </mycustomcontrol>
but problem approach that, make our xaml too verbose. , don't it. i'm looking solution may save me polluting xaml i'm using custom control.
thanks in anticipation!
.
i agree of martin says controltemplates being pretty or nothing thing in wpf , pretty frustrated myself when came conclusion.
if writing own custom control can make more flexible why composing or offering ability template pices of control. example can @ newer wpf datagrid control has ability template different pieces of control. other headered content controls have separate template content , header portion of control making possible replace 1 not other.
Comments
Post a Comment