Ejemplo n.º 1
0
 /// <summary>
 /// Updated the observed collection when the vote display mode is changed.
 /// </summary>
 private void ChangeVotesDisplayed()
 {
     VoteView1.Refresh();
     VoteView2.Refresh();
     VoteView1.MoveCurrentToFirst();
     VoteView2.MoveCurrentToFirst();
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Shorthand call to run both collection updates.
        /// </summary>
        private void UpdateVoteCollections()
        {
            VoteView1.Refresh();
            VoteView2.Refresh();

            if (lastPosition1 > VoteView1.Count)
            {
                VoteView1.MoveCurrentToLast();
            }
            else
            {
                VoteView1.MoveCurrentToPosition(lastPosition1);
            }

            if (lastPosition2 < 0)
            {
                VoteView2.MoveCurrentTo(lastSelected2 ?? "");
            }
            else if (lastPosition2 > VoteView2.Count)
            {
                VoteView2.MoveCurrentToLast();
            }
            else
            {
                VoteView2.MoveCurrentToPosition(lastPosition2);
            }

            // Retain the new position.
            lastPosition1 = VoteView1.CurrentPosition;
            lastPosition2 = VoteView2.CurrentPosition;
        }