EDIT No. 2:
public void ReverseOrderRegBtns()
{
ICollectionView view = CollectionViewSource.GetDefaultView(GlobalObservableCol.regBtns);
view.SortDescriptions.Add(new SortDescription("ReverseOrder", ListSortDirection.Ascending));
view.Refresh();
}
Not sure how to approach ICollectionView, it also interrupts timers that execute some logic. For some reason, it interrupts my time, which starts counting down when a button is created.
My application has several timers, so the buttons that are created receive updates with possible new content every x seconds.
EDIT:
Data binding is as follows:
<ListBox x:Name="lbRegistration" ItemsSource="{Binding regBtnsReverse, ElementName=Window}" Background="{x:Null}"
Old: public ObservableCollection RegBtns {get {if (GlobalObservableCol.regBtns == null) {return new ObservableCollection (); } return GlobalObservableCol.regBtns; }}
( ), ObserableCol
public IEnumerable<RegistrationButton> RegBtns
{
get
{
return GlobalObservableCol.regBtnsReverse;
}
}
IEnumerable , ObservableCollection.
, IENumerable. NumbersReverse
, MainWindow.xls?
ObservableCollection, WPF.
(listbox).
, 1, 2, 3,...
, , .
, 3, 2, 1.
, Observable .
, ( ).
?
,
PeterP