Further sorting and remove books refinements
This commit is contained in:
parent
efd6156fa8
commit
7b7e1d8574
9 changed files with 89 additions and 46 deletions
|
|
@ -3,10 +3,15 @@ using System.Collections.Generic;
|
|||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ReactiveUI;
|
||||
|
||||
namespace LibationWinForms.AvaloniaUI.ViewModels
|
||||
{
|
||||
public class MainWindowViewModel
|
||||
public class MainWindowViewModel : ViewModelBase
|
||||
{
|
||||
private string _removeBooksButtonText = "Remove # Books from Libation";
|
||||
private bool _removeButtonsVisible = true;
|
||||
public string RemoveBooksButtonText { get => _removeBooksButtonText; set => this.RaiseAndSetIfChanged(ref _removeBooksButtonText, value); }
|
||||
public bool RemoveButtonsVisible { get => _removeButtonsVisible; set => this.RaiseAndSetIfChanged(ref _removeButtonsVisible, value); }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
|
|||
/// sorted by series index, ascending. Stable sorting is achieved by comparing the GridEntry.ListIndex
|
||||
/// properties when 2 items compare equal.
|
||||
/// </summary>
|
||||
internal class RowComparer : IComparer
|
||||
internal class RowComparer : IComparer, IComparer<GridEntry2>
|
||||
{
|
||||
private static readonly PropertyInfo HeaderCellPi = typeof(DataGridColumn).GetProperty("HeaderCell", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
private static readonly PropertyInfo CurrentSortingStatePi = typeof(DataGridColumnHeader).GetProperty("CurrentSortingState", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
|
@ -81,7 +81,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
|
|||
return geA.SeriesIndex.CompareTo(geB.SeriesIndex) * (SortDirection is ListSortDirection.Ascending ? 1 : -1);
|
||||
|
||||
//a and b are children of different series.
|
||||
return Compare(parentA, parentB);
|
||||
return InternalCompare(parentA, parentB);
|
||||
}
|
||||
|
||||
//Avalonia doesn't expose the column's CurrentSortingState, so we must get it through reflection
|
||||
|
|
@ -102,5 +102,10 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
|
|||
else
|
||||
return compareResult;
|
||||
}
|
||||
|
||||
public int Compare(GridEntry2 x, GridEntry2 y)
|
||||
{
|
||||
return Compare((object)x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace LibationWinForms.AvaloniaUI.ViewModels
|
|||
|
||||
public SeriesEntrys2(LibraryBook parent, IEnumerable<LibraryBook> children)
|
||||
{
|
||||
Liberate = new LiberateButtonStatus2(IsSeries);
|
||||
Liberate = new LiberateButtonStatus2(IsSeries) { Expanded = true };
|
||||
SeriesIndex = -1;
|
||||
LibraryBook = parent;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue