private void UpdateOwned() { var owned = false; if (Model != null && Model.User != null) { if (Model.User.Login.ToLower().Equals(Application.Account.Username.ToLower())) { owned = true; } } if (owned) { NavigationItem.RightBarButtonItem = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Edit, () => { //We need to make sure we have the FULL gist this.DoWork(() => { var gist = Application.Client.API.GetGist(Id).Data; InvokeOnMainThread(() => { var gistController = new EditGistController(gist); gistController.Created = (id) => { Model = null; Refresh(); }; var navController = new UINavigationController(gistController); PresentViewController(navController, true, null); }); }); })); } else { NavigationItem.RightBarButtonItem = new UIBarButtonItem(NavigationButton.Create(Images.Buttons.Fork, () => { NavigationItem.RightBarButtonItem.Enabled = false; this.DoWork(() => { var forkedGist = Application.Client.API.ForkGist(Id); InvokeOnMainThread(delegate { NavigationController.PushViewController(new GistInfoController(forkedGist.Data.Id), true); }); }, null, () => { NavigationItem.RightBarButtonItem.Enabled = true; }); })); } }
public EditSource(EditGistController dvc) : base(dvc) { _parent = dvc; }
public EditSource(EditGistController dvc) : base (dvc) { _parent = dvc; }