Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Strongly Typed ItemsControls

$
0
0
Hey all,

I was just coding up a WPF storm and I realized how much I was casting selected items in listboxes, comboboxes, etc.

Wouldn't it have made sense to make ItemsControl generic, so that you could declare a combobox as ComboBox<Users>, and then the items and selected items would be strongly typed?  If you wanted to store "anything" then you could easily just do ComboBox<object>, but from my experience, 95% of the time an ItemsControl always binds to 1 type of object or several with a common base class.

Thoughts?

Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>