Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Bind the UI for adding subscriptions with the Reader API

  • Loading branch information...
commit a88409c873da92c12d4f0174922798ca94e59259 1 parent be5e3ff
Ionuț G. Stan authored

Showing 1 changed file with 14 additions and 8 deletions. Show diff stats Hide diff stats

  1. +14 8 Nemira/MainWindow.xaml.cs
22 Nemira/MainWindow.xaml.cs
@@ -22,6 +22,8 @@ namespace Nemira
22 22 {
23 23 public partial class MainWindow : Window
24 24 {
  25 + private ReaderAccount readerAccount;
  26 +
25 27 public MainWindow()
26 28 {
27 29 InitializeComponent();
@@ -53,13 +55,15 @@ private void PopulateContentPane(string content)
53 55
54 56 public void OpenAccount(string email, string pass)
55 57 {
56   - PopulateSubscriptionsTree(email, pass);
  58 + this.readerAccount = new ReaderAccount(email, pass);
  59 +
  60 + PopulateSubscriptionsTree();
57 61 Show();
58 62 }
59 63
60   - private void PopulateSubscriptionsTree(string email, string pass)
  64 + private void PopulateSubscriptionsTree()
61 65 {
62   - subscriptions.ItemsSource = new Subscriptions(new ReaderAccount(email, pass));
  66 + subscriptions.ItemsSource = new Subscriptions(readerAccount);
63 67 }
64 68
65 69 private void OnAddFeed(object sender, RoutedEventArgs e)
@@ -118,12 +122,14 @@ private void OnHyperlinkMouseLeave(object sender, RoutedEventArgs e)
118 122
119 123 private void OnAddSubscription(object sender, RoutedEventArgs e)
120 124 {
121   - //var addSubscriptionWindow = new AddSubscription();
122   - //addSubscriptionWindow.Owner = this;
123   - //addSubscriptionWindow.ShowDialog();
  125 + var addSubscriptionDialog = new AddSubscription();
  126 + addSubscriptionDialog.Owner = this;
124 127
125   - //MessageBox.Show(addSubscriptionWindow.FeedUrl.Text);
126   - MessageBox.Show("Not Implemented");
  128 + if (addSubscriptionDialog.ShowDialog() == true)
  129 + {
  130 + readerAccount.AddSubscription(addSubscriptionDialog.FeedUrl);
  131 + subscriptions.ItemsSource = new Subscriptions(readerAccount);
  132 + }
127 133 }
128 134 }
129 135

0 comments on commit a88409c

Please sign in to comment.
Something went wrong with that request. Please try again.