I am using ItemsControl in my application and its ItemSource is an observable collection.
<ItemsControl ItemsSource="{Binding ASPTrunks}"
ItemTemplate="{StaticResource ASPTrunkTemplate}"
Style="{StaticResource ItemControlStyle}">
ASPTrunks has a property named SpTypeName. I want controls in my ItemsControl to be sorted in alphabetical order of SpTypeName. what is the better way to do it. Do I need to use CollectionViewSource or is it good to sort collection programatically? if I need to use CollectionViewSource I will use it as per this link.
Either approach is fine, it will depend on if the sorting is view specific and you wish to reuse the collection in various views, then it makes sense to do the sorting in the view.