private void OpenPhotoFullScreen() { string photoBase64 = Convert.ToBase64String(PhotoSource); var photoPage = new PhotoFullScreenPage(photoBase64, null); photoPage.BackgroundColor = Color.Black; var navigation = new NavigationPage(photoPage); navigation.BackgroundColor = Color.Black; navigation.BarTextColor = Color.White; navigation.BarBackgroundColor = Color.Black; Navigation.PushModalAsync(navigation); }
private void AddCommands() { //pull to refresh var refreshCommand = new Command(() => { RefreshDetails(); }); PullToRefresh.RefreshCommand = refreshCommand; //location var locationTapCommand = new Command(async() => { bool isVisible = !LocationDetailsStackView.IsVisible; if (isVisible) { LocationDetailsStackView.IsVisible = true; await LocationDetailsStackView.FadeTo(1, 500, Easing.SinIn); } else { await LocationDetailsStackView.FadeTo(0, 250, Easing.SinOut); LocationDetailsStackView.IsVisible = false; } LocationDetailsStackView.IsVisible = isVisible; if (isVisible) { LocationArrow.Source = "dropdown_arrow.png"; } else { LocationArrow.Source = "right_arrow.png"; } }); XamEffects.Commands.SetTap(LocationTopStackView, locationTapCommand); //info var infoTapCommand = new Command(async() => { bool isVisible = !InfoDetailsStackView.IsVisible; if (isVisible) { InfoDetailsStackView.IsVisible = true; await InfoDetailsStackView.FadeTo(1, 500, Easing.SinIn); } else { await InfoDetailsStackView.FadeTo(0, 250, Easing.SinOut); InfoDetailsStackView.IsVisible = false; } InfoDetailsStackView.IsVisible = isVisible; if (isVisible) { InfoArrow.Source = "dropdown_arrow.png"; } else { InfoArrow.Source = "right_arrow.png"; } }); XamEffects.Commands.SetTap(InfoTopStackView, infoTapCommand); var openPhotoCommand = new Command(() => { var photoPage = new PhotoFullScreenPage(photoBase64, null); photoPage.BackgroundColor = Color.Black; var navigation = new NavigationPage(photoPage); navigation.BackgroundColor = Color.Black; navigation.BarTextColor = Color.White; navigation.BarBackgroundColor = Color.Black; Navigation.PushModalAsync(navigation); }); XamEffects.Commands.SetTap(PhotoImage, openPhotoCommand); var openBarcodeCommand = new Command(() => { var photoPage = new PhotoFullScreenPage(null, BarcodeImage.BarcodeValue); photoPage.BackgroundColor = Color.Black; var navigation = new NavigationPage(photoPage); navigation.BackgroundColor = Color.Black; navigation.BarTextColor = Color.White; navigation.BarBackgroundColor = Color.Black; Navigation.PushModalAsync(navigation); }); XamEffects.Commands.SetTap(BarcodeImage, openBarcodeCommand); var blockChainLinkCommand = new Command(() => { Device.OpenUri(new Uri(ViewModel.BlockchainUrl)); }); XamEffects.Commands.SetTap(BlockChainLinkLabel, blockChainLinkCommand); var packageLinkCommand = new Command(() => { Device.OpenUri(new Uri(ViewModel.PaketUrl)); }); XamEffects.Commands.SetTap(PackageLinkLabel, packageLinkCommand); //Users var usersTapCommand = new Command(async() => { bool isVisible = !UsersDetailsStackView.IsVisible; if (isVisible) { UsersDetailsStackView.IsVisible = true; await UsersDetailsStackView.FadeTo(1, 500, Easing.SinIn); } else { await UsersDetailsStackView.FadeTo(0, 250, Easing.SinOut); UsersDetailsStackView.IsVisible = false; } UsersDetailsStackView.IsVisible = isVisible; if (isVisible) { UsersArrow.Source = "dropdown_arrow.png"; } else { UsersArrow.Source = "right_arrow.png"; } }); XamEffects.Commands.SetTap(UsersTopStackView, usersTapCommand); //Events var eventsTapCommand = new Command(async() => { bool isVisible = !EventsDetailsStackView.IsVisible; if (isVisible) { EventsDetailsStackView.IsVisible = true; await EventsDetailsStackView.FadeTo(1, 500, Easing.SinIn); } else { await EventsDetailsStackView.FadeTo(0, 250, Easing.SinOut); EventsDetailsStackView.IsVisible = false; } EventsDetailsStackView.IsVisible = isVisible; if (isVisible) { EventsArrow.Source = "dropdown_arrow.png"; } else { EventsArrow.Source = "right_arrow.png"; } }); XamEffects.Commands.SetTap(EventsTopStackView, eventsTapCommand); }