xaml - For WPF, Is it overkill to use a setter to set the itemtemplate property? -
when searched internet find out how set itemtemplate listbox, found example used style setter in window.resources this. so, have couple of options, can either create datatemplate in window.resources, or, create style setter. overkill set style instead of datatemplate? method should use?
thank you.
you can't 1 or other better, depends. implicit datatemplates nice way globally (even if part of visual tree) how type should look. while using itemtemplate allows indicate how should in given itemscontrol (i.e. listbox, combobox, etc.).
you can use combination of both of them, allows have "default" look, customize per control or control type.
even itemtemplate, can set globally listboxes, or 1 listbox instance. again, 1 method better, not. depends on trying do.
Comments
Post a Comment