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); } } }
// 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); } } }