I want to create a usercontrol that takes lists of different objects. These objects would be assigned to the control at design time. Now I want to be able to use linq to object to sort this list inside the usercontrol. Can anyone give me any ideas as how to go about it?
I want to create a usercontrol that takes lists of different objects. These objects
Share
Add a
DependencyPropertyof typeObservableCollection<T>to your user control class (call itMyItemsSourcefor example). In your containing XAML, bind that property to your Linq collection, and inside your user control, bind yourListBox(or otherItemsControl) to the property as follows:Alternatively, you can set the
Nameproperty inside the user control on the top level element (theUserControlelement) to for exampleMyUserControl, and bind against anElementNameinstead of aRelativeSourceas such: