Пример #1
0
        async public void RefreshData(IFNewsService Service)
        {
            LoggedIn = Settings.wpLoggedIn;

            if (LoggedIn)
            {
                if (Settings.WP_AuthCookie != null && Settings.WP_AuthCookie.User != null)
                {
                    Settings.WP_AuthCookie.User.Capitalize = Settings.WP_AuthCookie.User.Displayname.ToUpper() [0] + "";
                    User = Settings.WP_AuthCookie.User;
                }
                else
                {
                }
            }

            if (Settings.Categories == null)
            {
                var cats = await Service.GetListCategory(new RequestListCategory());

                Settings.Categories = cats.Categories;
            }

            OptionItems.Clear();
            if (Settings.Categories.Count == 0)
            {
                var cats = await Service.GetListCategory(new RequestListCategory());

                Settings.Categories = cats.Categories;
            }

            AddCategories(true);
        }
		async public void RefreshData(IFNewsService Service){
			LoggedIn = Settings.wpLoggedIn;

			if (LoggedIn) {
				if (Settings.WP_AuthCookie != null && Settings.WP_AuthCookie.User != null) {
					Settings.WP_AuthCookie.User.Capitalize = Settings.WP_AuthCookie.User.Displayname.ToUpper () [0] + "";
					User = Settings.WP_AuthCookie.User;
				} else {

				}
			}

			if (Settings.Categories == null) {
				var cats = await Service.GetListCategory (new RequestListCategory ());
				Settings.Categories = cats.Categories;
			}

			OptionItems.Clear();
			if (Settings.Categories.Count == 0) {
				var cats = await Service.GetListCategory (new RequestListCategory ());
				Settings.Categories = cats.Categories;
			}

			AddCategories (true);
		}
		public BaseViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin)
		{
			Service = service;

			_deviceInfoPlugin = deviceInfoPlugin;
			DeviceInfo = _deviceInfoPlugin.GetDeviceInfo();
			Settings.DeviceInfo = DeviceInfo;
			Status = _deviceInfoPlugin.NetworkStatus;
		}
Пример #4
0
        public BaseViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin)
        {
            Service = service;

            _deviceInfoPlugin   = deviceInfoPlugin;
            DeviceInfo          = _deviceInfoPlugin.GetDeviceInfo();
            Settings.DeviceInfo = DeviceInfo;
            Status = _deviceInfoPlugin.NetworkStatus;
        }
Пример #5
0
        public LoginViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
        {
                        #if DEBUG
//			Username = "******";
//			Password= "******";
                        #endif

            //IsLoading = false;
            try {
                LoadSavedData();
            } catch (Exception e) {
            }
        }
		public LoginViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
        {
			#if DEBUG
//			Username = "******";
//			Password= "******";
			#endif

			//IsLoading = false;
			try {
				LoadSavedData();
			} catch (Exception e ){
			}
        }
		public RootViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin):base(service,deviceInfoPlugin)
		{
			if (Settings.USE_RECENT_POSTS ){
				Home = new RecentPostsViewModel(service, deviceInfoPlugin);
				((RecentPostsViewModel)Home).Init(Settings.RECENT_POST_CATEGORY_ID, "Home");
			} else {
				Home = new HomeViewModel(service, deviceInfoPlugin);
			}
			Menu = new MenuViewModel();
			Service = service;

			Settings.RootViewModel = this;
			Mvx.Trace ("Init RootViewModel");
		}
Пример #8
0
        public RootViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
        {
            if (Settings.USE_RECENT_POSTS)
            {
                Home = new RecentPostsViewModel(service, deviceInfoPlugin);
                ((RecentPostsViewModel)Home).Init(Settings.RECENT_POST_CATEGORY_ID, "Home");
            }
            else
            {
                Home = new HomeViewModel(service, deviceInfoPlugin);
            }
            Menu    = new MenuViewModel();
            Service = service;

            Settings.RootViewModel = this;
            Mvx.Trace("Init RootViewModel");
        }
		public PostViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin) {
			SupportLike = false;
		}
Пример #10
0
 public HomeViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
 {
     GroupedPosts = new ObservableCollection <CatalogPostsGroup> ();
 }
		public RecentPostsViewModel (IFNewsService service, IMvxDeviceInfo deviceInfoPlugin): base(service, deviceInfoPlugin)
		{
			
		}
 public PostCommentsViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
 {
 }
		public PostCommentsViewModel (IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
		{
		}
Пример #14
0
 public PostViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
 {
     SupportLike = false;
 }
Пример #15
0
 public RecentPostsViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
 {
 }
Пример #16
0
 public CatalogNewsViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin) : base(service, deviceInfoPlugin)
 {
     ListPost = new ObservableCollection <Post> ();
 }
		public CatalogNewsViewModel(IFNewsService service, IMvxDeviceInfo deviceInfoPlugin): base(service, deviceInfoPlugin) {
			ListPost = new ObservableCollection<Post> ();
		}