summaryrefslogtreecommitdiff
path: root/Juick/MainPage.xaml.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Juick/MainPage.xaml.cs')
-rw-r--r--Juick/MainPage.xaml.cs63
1 files changed, 26 insertions, 37 deletions
diff --git a/Juick/MainPage.xaml.cs b/Juick/MainPage.xaml.cs
index eba1635..d6b0b08 100644
--- a/Juick/MainPage.xaml.cs
+++ b/Juick/MainPage.xaml.cs
@@ -1,20 +1,12 @@
using System;
using System.Collections.Generic;
-using System.Linq;
-using System.Net;
using System.Text;
using System.Windows;
using System.Windows.Controls;
-using System.Windows.Documents;
-using System.Windows.Input;
-using System.Windows.Media;
-using System.Windows.Media.Animation;
-using System.Windows.Shapes;
-using Juick.Classes;
+using System.Windows.Data;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Notification;
-using Microsoft.Xna.Framework.Media;
-using System.Windows.Media.Imaging;
+using Microsoft.Phone.Shell;
namespace Juick
{
@@ -30,7 +22,7 @@ namespace Juick
//string channelName = "JuickChannel"; // unused variable
InitializeComponent();
-
+
/* // Try to find the push channel.
pushChannel = HttpNotificationChannel.Find(channelName);
@@ -71,6 +63,29 @@ namespace Juick
// Set the data context of the listbox control to the sample data
Home.DataContext = App.MyFeedView;
Last.DataContext = App.LastView;
+ Loaded += (o, args) =>
+ {
+ var progressIndicator = SystemTray.ProgressIndicator;
+
+ if (progressIndicator != null)
+ {
+ return;
+ }
+
+ progressIndicator = new ProgressIndicator();
+
+ SystemTray.SetProgressIndicator(this, progressIndicator);
+
+ Binding binding = new Binding("IsDataLoading") { Source = Home.DataContext };
+
+ BindingOperations.SetBinding(
+ progressIndicator, ProgressIndicator.IsVisibleProperty, binding);
+
+ binding = new Binding("IsDataLoading") { Source = Home.DataContext };
+
+ BindingOperations.SetBinding(
+ progressIndicator, ProgressIndicator.IsIndeterminateProperty, binding);
+ };
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
@@ -144,32 +159,6 @@ namespace Juick
);
}
- private void ListBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- // If selected index is -1 (no selection) do nothing
- if (((ListBox)sender).SelectedIndex == -1)
- return;
-
- // Navigate to the new page
- 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;
- }
-
- private void LastBoxSelectionChanged(object sender, SelectionChangedEventArgs e)
- {
- // If selected index is -1 (no selection) do nothing
- if (((ListBox)sender).SelectedIndex == -1)
- return;
-
- // Navigate to the new page
- NavigationService.Navigate(new Uri(string.Format("/ThreadView.xaml?mid={0}", App.LastView.Items[((ListBox)sender).SelectedIndex].MID), UriKind.Relative));
-
- // Reset selected index to -1 (no selection)
- ((ListBox)sender).SelectedIndex = -1;
- }
-
private void ApplicationBarIconButtonClick(object sender, EventArgs e)
{
App.MyFeedView.Items.Clear();