Permalink
Browse files

Add unsubscribing functionality to the UI

  • Loading branch information...
igstan committed Oct 24, 2010
1 parent 745bd97 commit 2dd815c14b6374543eb2b94a6e878d537cabd46f
Showing with 15 additions and 0 deletions.
  1. +1 −0 Nemira/MainWindow.xaml
  2. +14 −0 Nemira/MainWindow.xaml.cs
View
@@ -105,6 +105,7 @@
Padding="5,5,5,5"
Name="deleteSubscription"
ToolTip="Delete Subscription"
+ Click="OnDeleteSubscription"
Style="{DynamicResource DeleteSubscriptionButton}"/>
</ToolBar>
</ToolBarTray>
View
@@ -143,6 +143,20 @@ private void OnAddSubscription(object sender, RoutedEventArgs e)
subscriptions.ItemsSource = new Subscriptions(readerAccount);
}
}
+
+ private void OnDeleteSubscription(object sender, RoutedEventArgs e)
+ {
+ var subscription = subscriptions.SelectedItem as Subscription;
+ var message = String.Format("Unsubscribe from {0}?", subscription.Title);
+ var title = "Confirm Unsubscribe";
+ var button = MessageBoxButton.OKCancel;
+ var icon = MessageBoxImage.Warning;
+
+ if (MessageBox.Show(message, title, button, icon) == MessageBoxResult.OK) {
+ readerAccount.RemoveSubscription(subscription);
+ subscriptions.ItemsSource = new Subscriptions(readerAccount);
+ }
+ }
}
public class Subscriptions : ObservableCollection<Subscription>

0 comments on commit 2dd815c

Please sign in to comment.