summaryrefslogtreecommitdiff
path: root/Juick/App.xaml.cs
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-04-01 13:34:49 +0400
committerGravatar Vitaly Takmazov2013-04-01 13:34:49 +0400
commitfb1fab2e1593ba13fae8eae519f5482525eb68a1 (patch)
treef3557b2e8991ec53fde46d05346fab2bd8fce37e /Juick/App.xaml.cs
parent57550f203995b61d600fae59832e409fd5feebcd (diff)
AppViewModel
Diffstat (limited to 'Juick/App.xaml.cs')
-rw-r--r--Juick/App.xaml.cs43
1 files changed, 9 insertions, 34 deletions
diff --git a/Juick/App.xaml.cs b/Juick/App.xaml.cs
index e20feec..e9fd258 100644
--- a/Juick/App.xaml.cs
+++ b/Juick/App.xaml.cs
@@ -15,46 +15,21 @@ namespace Juick
var current = ((App)App.Current).RootFrame;
current.Navigate(param);
}
- private static ViewModelBase _myfeed = null;
+ private static AppViewModel context = null;
- /// <summary>
- /// A static _myfeed used by the views to bind against.
- /// </summary>
- /// <returns>The MessageListViewModelBase object.</returns>
- public static ViewModelBase MyFeedView
+ public static AppViewModel AppContext
{
get
{
// Delay creation of the view model until necessary
- return _myfeed ?? (_myfeed = new ViewModelBase());
- }
- }
-
- private static ViewModelBase _last;
-
- public static ViewModelBase LastView
- {
- get
- {
- return _last ??
- (_last = new ViewModelBase { RestUri = "/messages?1=1" });
+ if (context == null) {
+ context = new AppViewModel();
+ context.Pages.Add(new PageViewModel(context));
+ context.Pages.Add(new PageViewModel(context) { RestUri = "/messages?1=1" });
+ };
+ return context;
}
- }
-
- private static AccountManager _acc;
-
- public static AccountManager Account
- {
- get { return _acc ?? (_acc = new AccountManager()); }
- }
-
- private static RestClient _cl;
- public static RestClient Client
- {
- get { return _cl ?? (_cl = new RestClient("http://api.juick.com") {
- UserAgent = "Juick 0.999/Windows Phone " + Environment.OSVersion.Version }); }
- }
-
+ }
/// <summary>
/// Provides easy access to the root frame of the Phone Application.
/// </summary>