Exemplo n.º 1
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.º 2
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);
            });
        }