示例#1
0
        private void Load()
        {
            var model = new ReleaseRazorViewModel {
                Body = ViewModel.ContentText, Release = ViewModel.ReleaseModel
            };

            LoadContent(new ReleaseRazorView {
                Model = model
            }.GenerateString());
        }
示例#2
0
        public ReleaseView(INetworkActivityService networkActivityService)
            : base(networkActivityService)
        {
            Web.ScalesPageToFit = true;

            this.WhenViewModel(x => x.ShowMenuCommand)
            .Subscribe(x => NavigationItem.RightBarButtonItem = x.ToBarButtonItem(UIBarButtonSystemItem.Action));

            this.WhenViewModel(x => x.ContentText).IsNotNull().Subscribe(contentText =>
            {
                var model = new ReleaseRazorViewModel {
                    Body = contentText, Release = ViewModel.ReleaseModel
                };
                LoadContent(new ReleaseRazorView {
                    Model = model
                }.GenerateString());
            });
        }
示例#3
0
        public ReleaseView()
        {
            Web.ScalesPageToFit = true;

            this.WhenAnyValue(x => x.ViewModel.ShowMenuCommand)
            .Select(x => x.ToBarButtonItem(UIBarButtonSystemItem.Action))
            .Subscribe(x => NavigationItem.RightBarButtonItem = x);

            this.WhenAnyValue(x => x.ViewModel.ContentText).IsNotNull().Subscribe(contentText =>
            {
                var release     = ViewModel.ReleaseModel;
                var name        = string.IsNullOrEmpty(release.Name) ? release.TagName : release.Name;
                var releaseTime = release.PublishedAt.HasValue ? release.PublishedAt.Value.UtcDateTime.Humanize() : release.CreatedAt.UtcDateTime.Humanize();
                var model       = new ReleaseRazorViewModel {
                    Body = contentText, Author = release.Author.Login, Name = name, AuthorAvatarUrl = release.Author.AvatarUrl, ReleaseTime = releaseTime
                };
                LoadContent(new ReleaseRazorView {
                    Model = model
                }.GenerateString());
            });
        }