public static GistViewController FromGist(Gist gist) { return(new GistViewController { ViewModel = GistViewModel.FromGist(gist) }); }
public GistViewController(string id) { Title = "Gist"; ViewModel = new GistViewModel(id); _header = new HeaderView(0f) { Title = "Gist: " + id }; ToolbarItems = new [] { new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), new UIBarButtonItem((_starButton = ToolbarButton.Create(Images.Gist.Star, StarButtonPress))), new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), (_userButton = new UIBarButtonItem(ToolbarButton.Create(Images.Gist.User, UserButtonPress))), new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace), (_shareButton = new UIBarButtonItem(ToolbarButton.Create(Images.Gist.Share, ShareButtonPress))), new UIBarButtonItem(UIBarButtonSystemItem.FlexibleSpace) }; //Disable these buttons until the gist object becomes valid _userButton.Enabled = false; _shareButton.Enabled = false; ViewModel.Bind(x => x.Gist, (gist) => { UpdateOwned(); RenderGist(gist); }); ViewModel.Bind(x => x.IsStarred, isStarred => { _starButton.SetImage(isStarred ? Images.Gist.StarHighlighted : Images.Gist.Star, UIControlState.Normal); _starButton.SetNeedsDisplay(); }); }
public GitDetailPage(GistViewModel gistViewModel) { InitializeComponent(); if (gistViewModel != null) { BindingContext = Context = gistViewModel; } }
public FavoriteDetailPage(GistViewModel gistViewModel) { InitializeComponent(); BindingContext = Context = gistViewModel; }
public FavoriteListPage() { InitializeComponent(); BindingContext = Context = new GistViewModel(false); }
public GitListPage() { InitializeComponent(); BindingContext = Context = new GistViewModel(); }
public CreateGistFileCommandArgs(string content, GistViewModel parentGist) { Content = content; ParentGist = parentGist; }