Exemplo n.º 1
0
 public EditArticleViewModel(IArticleResources articleResources, INavigator navigator)
 {
     _articleResources = articleResources;
     _navigator        = navigator;
     this.Title        = ko.observable.Self <string>();
     this.Body         = ko.observable.Self <string>();
     this.Description  = ko.observable.Self <string>();
     this.Tags         = ko.observable.Self <string>();
 }
Exemplo n.º 2
0
        public ArticleViewModel(IArticleResources articleResources, IUserService userService,
                                INavigator navigator, IProfileResources profileResources)
        {
            _articleResources = articleResources;
            _userService      = userService;
            _navigator        = navigator;
            _profileResources = profileResources;

            this.Article  = new Article();
            this.Comments = ko.observableArray.Self <Comment>();
            this.Comment  = ko.observable.Self <string>();
        }
Exemplo n.º 3
0
 public HomeViewModel(IArticleResources resources, ISettings settings, IMessenger messenger,
                      IUserService userService, IFeedResources feedResources, INavigator navigator)
 {
     _resources          = resources;
     _settings           = settings;
     _messenger          = messenger;
     _userService        = userService;
     _feedResources      = feedResources;
     _navigator          = navigator;
     this.Articles       = ko.observableArray.Self <Article>();
     this.Pages          = ko.observableArray.Self <Paginator>();
     this.Tags           = ko.observableArray.Self <string>();
     this.Tabs           = ko.observableArray.Self <string>();
     this.IsLogged       = ko.observable.Self <bool>(this._userService.IsLogged);
     this.ActiveTabIndex = ko.observable.Self <int>(-1);
 }
Exemplo n.º 4
0
        public ProfileViewModel(IProfileResources profileResource, IUserService userService,
                                IArticleResources articleResources, INavigator navigator, IMessenger messenger)
        {
            this.ProfileModel     = new ProfileModel();
            this._profileResource = profileResource;
            _userService          = userService;
            _articleResources     = articleResources;
            _navigator            = navigator;
            _messenger            = messenger;

            this.ActiveTabIndex = ko.observable.Self <int>(0);
            this.IsLogged       = ko.observable.Self <bool>(this._userService.IsLogged);

            this._messenger.Subscribe <UserService>(this, SpafApp.Messages.LoginDone, service =>
            {
                this.IsLogged.Self(true);
            });
        }