summaryrefslogtreecommitdiff
path: root/Juick/MainPage.xaml.cs
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2012-03-10 22:14:25 +0400
committerGravatar Vitaly Takmazov2012-03-10 22:14:25 +0400
commit2b387fb5626a57e3a6473eed66816df80152cd49 (patch)
tree0b2f2ede5dcc79c1adbb8b64c2296aaeed1416fb /Juick/MainPage.xaml.cs
parent4a664984f58b00493a61cb19fafc0ca01d35b930 (diff)
refactoring, tags
Diffstat (limited to 'Juick/MainPage.xaml.cs')
-rw-r--r--Juick/MainPage.xaml.cs24
1 files changed, 15 insertions, 9 deletions
diff --git a/Juick/MainPage.xaml.cs b/Juick/MainPage.xaml.cs
index 1654c1b..a7ba541 100644
--- a/Juick/MainPage.xaml.cs
+++ b/Juick/MainPage.xaml.cs
@@ -22,19 +22,24 @@ namespace Juick
InitializeComponent();
// Set the data context of the listbox control to the sample data
- DataContext = App.ViewModel;
+ Home.DataContext = App.MyFeedView;
+ Last.DataContext = App.LastView;
Loaded += MainPage_Loaded;
}
- // Load data for the ViewModel MyFeed
+ // Load data for the _viewModelBase Items
private void MainPage_Loaded(object sender, RoutedEventArgs e)
{
- if (!App.ViewModel.IsDataLoaded)
+ if (!App.MyFeedView.IsDataLoaded)
{
if (string.IsNullOrEmpty(App.Account.Credentials.UserName))
NavigationService.Navigate(new Uri("/LoginView.xaml", UriKind.Relative));
else
- App.ViewModel.LoadData();
+ {
+ App.MyFeedView.LoadData();
+ App.LastView.LoadData();
+ }
+
}
}
@@ -45,7 +50,7 @@ namespace Juick
return;
// Navigate to the new page
- NavigationService.Navigate(new Uri("/ThreadView.xaml?mid=" + App.ViewModel.MyFeed[((ListBox)sender).SelectedIndex].MID, UriKind.Relative));
+ NavigationService.Navigate(new Uri("/ThreadView.xaml?mid=" + App.MyFeedView.Items[((ListBox)sender).SelectedIndex].MID, UriKind.Relative));
// Reset selected index to -1 (no selection)
((ListBox)sender).SelectedIndex = -1;
@@ -58,7 +63,7 @@ namespace Juick
return;
// Navigate to the new page
- NavigationService.Navigate(new Uri(string.Format("/ThreadView.xaml?mid={0}&last=true", App.ViewModel.Last[((ListBox)sender).SelectedIndex].MID), UriKind.Relative));
+ NavigationService.Navigate(new Uri(string.Format("/ThreadView.xaml?mid={0}&last=true", App.LastView.Items[((ListBox)sender).SelectedIndex].MID), UriKind.Relative));
// Reset selected index to -1 (no selection)
((ListBox)sender).SelectedIndex = -1;
@@ -104,9 +109,10 @@ namespace Juick
private void ApplicationBarIconButtonClick(object sender, EventArgs e)
{
- App.ViewModel.MyFeed.Clear();
- App.ViewModel.Last.Clear();
- App.ViewModel.LoadData();
+ App.MyFeedView.Items.Clear();
+ App.LastView.Items.Clear();
+ App.MyFeedView.LoadData();
+ App.LastView.LoadData();
}
private void ApplicationBarMenuItemClick(object sender, EventArgs e)