wpf - Which one is better? Style or User Control?
Posted
by Archie
on Stack Overflow
See other posts from Stack Overflow
or by Archie
Published on 2010-04-29T07:49:43Z
Indexed on
2010/04/29
8:47 UTC
Read the original article
Hit count: 328
Hello,
I wanted to know which one amongst Style and UserControl would be better to use in WPF?
For example: I have created an image button in two different ways. One uses Style and ContentTemplate property is set. It uses one other class with dependency properties.
The other way is i have created a UserControl which has a button and its content property is set. UserControl.xaml.cs file also contains the dependency properties.
For Code details see the answers of this question:
http://stackoverflow.com/questions/2734825/custom-button-template-in-wpf
Which one would be better to use? Can anyone tell me in which scenario one should go for Style or UserControl or any CustomControl?
Thanks in advance.
© Stack Overflow or respective owner