Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Performance diff between Target="someType" and Target="{x:Type someType}" [duplicate]

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.

like image 296
Mo0gles Avatar asked Dec 19 '25 13:12

Mo0gles


1 Answers

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.

like image 103
Stephen Chung Avatar answered Dec 21 '25 04:12

Stephen Chung



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!