diff options
Diffstat (limited to 'Juick/App.xaml.cs')
-rw-r--r-- | Juick/App.xaml.cs | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/Juick/App.xaml.cs b/Juick/App.xaml.cs index 98dc31c..03e0d10 100644 --- a/Juick/App.xaml.cs +++ b/Juick/App.xaml.cs @@ -10,22 +10,31 @@ namespace Juick {
public partial class App : Application
{
- public void NavigateTo(Uri param) {
- RootFrame.Navigate(param);
+ public void NavigateTo(Uri param, bool removeFromStack = false)
+ {
+ var page = (PhoneApplicationPage) RootFrame.Content;
+ var service = page.NavigationService;
+ service.Navigate(param);
+ if (removeFromStack)
+ {
+ page.Dispatcher.BeginInvoke(() => service.RemoveBackEntry());
+ }
}
- private static AppViewModel context = null;
+ private static AppViewModel _context = null;
public static AppViewModel AppContext
{
get
{
// Delay creation of the view model until necessary
- if (context == null) {
- context = new AppViewModel();
- context.Pages.Add(new PageViewModel(context) { RestUri = "/home?1=1" });
- context.Pages.Add(new PageViewModel(context) { RestUri = "/messages?1=1" });
+ if (_context == null) {
+ _context = new AppViewModel();
+ _context.Pages.Add(new PageViewModel(_context) { RestUri = "/home?1=1", Caption = "My feed"});
+ _context.Pages.Add(new PageViewModel(_context) { RestUri = "/messages?1=1", Caption = "Last"});
+ _context.Pages.Add(new PageViewModel(_context) { RestUri = "/messages?1=1&popular=1", Caption = "Top"});
+ _context.Pages.Add(new PageViewModel(_context) { RestUri = "/messages?1=1&media=all", Caption = "Images" });
};
- return context;
+ return _context;
}
}
/// <summary>
|