Skip to content
Permalink
Browse files

[skip ci] [WIP] ordering... bind problems in progress

  • Loading branch information...
molnard committed Nov 24, 2018
1 parent 512b33a commit 2607a0635f7cff30318914cbb485811d21c9fe04
@@ -78,7 +78,7 @@ void SortingArrow_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
}

public static readonly StyledProperty<bool?> SortDirectionProperty =
AvaloniaProperty.Register<SortingArrow, bool?>(nameof(SortDirection), defaultBindingMode: BindingMode.TwoWay);
AvaloniaProperty.Register<SortingArrow, bool?>(nameof(SortDirection), defaultBindingMode: BindingMode.TwoWay);

public bool? SortDirection
{
@@ -90,6 +90,8 @@ void SortingArrow_Click(object sender, Avalonia.Interactivity.RoutedEventArgs e)
}
}



private void RefreshArrowIcon()
{
switch (SortDirection)
@@ -58,17 +58,17 @@ public bool CanDeqeue
set
{
this.RaiseAndSetIfChanged(ref _statusSortDirection, value);
switch (value)
{
case null:
break;
case true:
Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => x.Status.CompareTo(y.Amount));
break;
case false:
Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => y.Status.CompareTo(x.Amount));
break;
}
//switch (value)
//{
// case null:
// break;
// case true:
// Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => x.Status.CompareTo(y.Amount));
// break;
// case false:
// Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => y.Status.CompareTo(x.Amount));
// break;
//}

}
}
@@ -78,42 +78,43 @@ public bool CanDeqeue
set
{
this.RaiseAndSetIfChanged(ref _amountSortDirection, value);
switch (value)
{
case null:
break;
case true:
Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => x.Amount.CompareTo(y.Amount));
break;
case false:
Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => y.Amount.CompareTo(x.Amount));
break;
}
if (value != null)
{
PrivacySortDirection = true;
//AmountSortDirection = null;
StatusSortDirection = true;
}
//switch (value)
//{
// case null:
// break;
// case true:
// Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => x.Amount.CompareTo(y.Amount));
// break;
// case false:
// Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => y.Amount.CompareTo(x.Amount));
// break;
//}
//if (value != null)
//{
// PrivacySortDirection = true;
// //AmountSortDirection = null;
// StatusSortDirection = true;
//}
}
}
public bool? PrivacySortDirection
{
get => _privacySortDirection;
set
{
this.RaiseAndSetIfChanged(ref _privacySortDirection,value);
switch (value)
{
case null:
break;
case true:
Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => x.AnonymitySet.CompareTo(y.AnonymitySet));
break;
case false:
Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => y.AnonymitySet.CompareTo(x.AnonymitySet));
break;
}

//switch (value)
//{
// case null:
// break;
// case true:
// Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => x.AnonymitySet.CompareTo(y.AnonymitySet));
// break;
// case false:
// Coins = _rootcoinlist.CreateDerivedCollection(x => x, x => true, (x, y) => y.AnonymitySet.CompareTo(x.AnonymitySet));
// break;
//}
this.RaiseAndSetIfChanged(ref _privacySortDirection, value);

}
}
@@ -191,7 +192,9 @@ public CoinListViewModel(IReactiveDerivedList<CoinViewModel> coins, Money preSel
}
});
SelectAllCheckBoxState = GetCheckBoxesSelectedState();

PrivacySortDirection = true;
AmountSortDirection = true;
StatusSortDirection = true;
}

void Coin_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)

0 comments on commit 2607a06

Please sign in to comment.
You can’t perform that action at this time.