Example #1
0
 private void SortUsersByRankDescending(object sender, RoutedEventArgs e)
 {
     FlyoutSortUsers.Hide();
     _lastUsersSortAction = SortUsersByRankDescending;
     VM.SortUsers(
         (u1, u2) =>
         - RankNumerizator.ConvertRankToInteger(u1.Rank)
         .CompareTo(RankNumerizator.ConvertRankToInteger(u2.Rank)));
 }
Example #2
0
 private void SortByHighestRank_Click(object sender, RoutedEventArgs e)
 {
     FlyoutSortGames.Hide();
     _lastGamesSortAction = SortByHighestRank_Click;
     VM.SortGames((g1, g2) =>
                  - Math.Max(
                      RankNumerizator.ConvertRankToInteger(g1.Black.Rank),
                      RankNumerizator.ConvertRankToInteger(g1.White.Rank)
                      )
                  .CompareTo(
                      Math.Max(
                          RankNumerizator.ConvertRankToInteger(g2.Black.Rank),
                          RankNumerizator.ConvertRankToInteger(g2.White.Rank)
                          )));
 }