public EditSiteToolBarItem(VaultViewSitePage page, string siteId) { _page = page; _siteId = siteId; Text = AppResources.Edit; Clicked += ClickedItem; }
private async void MoreClickedAsync(VaultListPageModel.Site site) { var buttons = new List <string> { AppResources.View, AppResources.Edit }; if (!string.IsNullOrWhiteSpace(site.Password.Value)) { buttons.Add(AppResources.CopyPassword); } if (!string.IsNullOrWhiteSpace(site.Username)) { buttons.Add(AppResources.CopyUsername); } if (!string.IsNullOrWhiteSpace(site.Uri.Value) && (site.Uri.Value.StartsWith("http://") || site.Uri.Value.StartsWith("https://"))) { buttons.Add(AppResources.GoToWebsite); } var selection = await DisplayActionSheet(site.Name, AppResources.Cancel, null, buttons.ToArray()); if (selection == AppResources.View) { var page = new VaultViewSitePage(site.Id); await Navigation.PushForDeviceAsync(page); } else if (selection == AppResources.Edit) { var page = new VaultEditSitePage(site.Id); await Navigation.PushForDeviceAsync(page); } else if (selection == AppResources.CopyPassword) { Copy(site.Password.Value, AppResources.Password); } else if (selection == AppResources.CopyUsername) { Copy(site.Username, AppResources.Username); } else if (selection == AppResources.GoToWebsite) { Device.OpenUri(new Uri(site.Uri.Value)); } }
private async void SiteSelected(object sender, SelectedItemChangedEventArgs e) { var site = e.SelectedItem as VaultListPageModel.Site; var page = new VaultViewSitePage(site.Id); await Navigation.PushForDeviceAsync(page); }