Possible Duplicate:
Difference between TargetType=“controlType” and TargetType=“{x:Type controlType}”
when to use {x:Type …}?
At Difference between TargetType="controlType" and TargetType="{x:Type controlType}" I can see that these different methods of setting type are basically the same. But I was wondering if there are any performance implications since I guess {x:Type} will instantiate a markup object.
I'd suggest that creating one fewer object is going to be beneficial to performance. However, in this case, the performance gain may be so small that you're better off considering readability of your code instead.
I always use {x:Type someType} as it makes it clear that here is a type I am talking about.
And when I change things later on, I can always search on {x:Type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With