Exemplo n.º 1
0
        private void redditNakedDownArrow_Click(object sender, RoutedEventArgs e)
        {
            if (sender is Button)
            {
                Button myButton      = (Button)sender;
                object maybeAComment = myButton.DataContext;

                if (maybeAComment is CustomComment)
                {
                    CustomComment myComment = (CustomComment)maybeAComment;
                    myComment.ChangeVote(VotableThing.VoteType.Downvote);
                }
            }
        }
Exemplo n.º 2
0
        // I think I have the behaviour right, maybe there is an issue in CustomComment??

        // Behaviour if the up arrow HAS been clicked and this click removes the vote (Sets it to None Vote)
        private void redditUpArrow_Click(object sender, RoutedEventArgs e)
        {
            // Is it a button that is sent to me?
            if (sender is Button)
            {
                Button myButton      = (Button)sender;
                object maybeAComment = myButton.DataContext;

                if (maybeAComment is CustomComment)
                {
                    CustomComment myComment = (CustomComment)maybeAComment;
                    myComment.ChangeVote(VotableThing.VoteType.None);
                }
            }
        }