using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using System.Collections.ObjectModel; using Juick.Classes; using RestSharp; namespace Juick.ViewModels { public class AppViewModel : ViewModelBase { private ObservableCollection _pages; public ObservableCollection Pages { get { if (_pages == null) _pages = new ObservableCollection(); return _pages; } } static readonly string IsDataLoadingPropertyName = ExpressionHelper.GetPropertyName(x => x.IsDataLoading); bool isDataLoading; public bool IsDataLoading { get { return isDataLoading; } set { isDataLoading = value; NotifyPropertyChanged(IsDataLoadingPropertyName); foreach (var page in Pages) { page.LoadMessagesPageCommand.NotifyCanExecuteChanged(); } } } private AccountManager _acc; public AccountManager Account { get { return _acc ?? (_acc = new AccountManager()); } } private RestClient _cl; public RestClient Client { get { return _cl ?? (_cl = new RestClient("http://api.juick.com") { UserAgent = "Juick 1.1/Windows Phone " + Environment.OSVersion.Version }); } } } }