using System; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Linq; using Juick.Classes; using JuickApi; using RestSharp; namespace Juick.ViewModels { public class AppViewModel : ViewModelBase { private ObservableCollection _pages; public ObservableCollection Pages { get { return _pages ?? (_pages = new ObservableCollection()); } } 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 }); } } } }