private async void FullDescription_OnTapped(object sender, EventArgs e) { var mainStackLayout = new StackLayout() { HeightRequest = Height - 150 }; var closeLabel = new IoniconsLabel() { Text = IoniconsIcon.IosCloseRound, Padding = new Thickness(0, 0, 45, 0), FontSize = 30, HorizontalOptions = LayoutOptions.EndAndExpand, }; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, oe) => { HideFrame(); }; closeLabel.GestureRecognizers.Add(tapGestureRecognizer); mainStackLayout.Children.Add(closeLabel); var fullDescriptionLabel = new Label() { Text = ViewModel.Product.FullDescription, TextType = TextType.Html, FontSize = 18 }; mainStackLayout.Children.Add(fullDescriptionLabel); AppearingFrame.Content = mainStackLayout; ViewModel.IsBottomModelVisible = true; await AppearingFrame.TranslateTo(0, 0); }
private async void Filter_OnClick(object sender, EventArgs e) { //on background click or on swipe hide filter content, now use close icon TODO var mainStackLayout = new StackLayout() { WidthRequest = Width - 50, Padding = 0, }; //add web filter options base on category implement spec attr TODO #region Close icon var closeLabel = new IoniconsLabel() { Text = IoniconsIcon.IosCloseRound, Padding = new Thickness(0, 10, 15, 0), FontSize = 30, HorizontalOptions = LayoutOptions.EndAndExpand, }; var closeTapGestureRecognizer = new TapGestureRecognizer(); closeTapGestureRecognizer.Tapped += (s, ea) => { AppearingFrame.TranslateTo(450, 0); ViewModel.IsRightModalVisible = false; }; closeLabel.GestureRecognizers.Add(closeTapGestureRecognizer); mainStackLayout.Children.Add(closeLabel); #endregion #region Bottom buttons var bottomButtonsStackLayout = new Grid() { VerticalOptions = LayoutOptions.EndAndExpand, Padding = 0, ColumnSpacing = 0 }; var resetLabel = new Label() { Text = TranslateExtension.Translate("Mobile.Reset"), BackgroundColor = Color.LightPink, TextColor = Color.Red, FontSize = 18, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, HeightRequest = 50 }; var resetTapGestureRecognizer = new TapGestureRecognizer(); resetTapGestureRecognizer.Tapped += (s, ea) => { ResetFilter(); }; resetLabel.GestureRecognizers.Add(resetTapGestureRecognizer); var filterLabel = new Label() { Text = TranslateExtension.Translate("Mobile.Filter"), BackgroundColor = Color.Red, TextColor = Color.White, FontSize = 18, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, HorizontalTextAlignment = TextAlignment.Center, VerticalTextAlignment = TextAlignment.Center, HeightRequest = 50 }; var filterTapGestureRecognizer = new TapGestureRecognizer(); filterTapGestureRecognizer.Tapped += (s, ea) => { Filter(); }; filterLabel.GestureRecognizers.Add(filterTapGestureRecognizer); bottomButtonsStackLayout.Children.Add(resetLabel, 0, 0); bottomButtonsStackLayout.Children.Add(filterLabel, 1, 0); mainStackLayout.Children.Add(bottomButtonsStackLayout); #endregion AppearingFrame.Content = mainStackLayout; ViewModel.IsRightModalVisible = true; await AppearingFrame.TranslateTo(0, 0); AppearingFrame.IsVisible = true; // on appearing frame is opened than close, set is visible false to xaml }
private void HideFrame() { AppearingFrame.TranslateTo(450, 0); ViewModel.IsRightModalVisible = false; }
private async void ProductSpec_OnTapped(object sender, EventArgs e) { var mainStackLayout = new StackLayout() { HeightRequest = Height - 150 }; var closeLabel = new IoniconsLabel() { Text = IoniconsIcon.IosCloseRound, Padding = new Thickness(0, 0, 45, 0), FontSize = 30, HorizontalOptions = LayoutOptions.EndAndExpand, }; var tapGestureRecognizer = new TapGestureRecognizer(); tapGestureRecognizer.Tapped += (s, oe) => { HideFrame(); }; closeLabel.GestureRecognizers.Add(tapGestureRecognizer); mainStackLayout.Children.Add(closeLabel); foreach (var specificationAttributeModel in ViewModel.Product.SpecificationAttributeModels) { var stackLayout = new StackLayout() { Orientation = StackOrientation.Horizontal }; var specLabel = new Label() { Text = specificationAttributeModel.SpecificationAttributeName, FontSize = 18, TextColor = Color.FromHex("#f3f3f3") }; var specValue = new Label() { Text = specificationAttributeModel.ValueRaw, FontSize = 18, TextColor = Color.FromHex("#f3f3f3"), HorizontalOptions = LayoutOptions.EndAndExpand }; var boxView = new BoxView() { Color = Color.Gainsboro, HeightRequest = 1 }; stackLayout.Children.Add(specLabel); stackLayout.Children.Add(specValue); stackLayout.Children.Add(boxView); mainStackLayout.Children.Add(stackLayout); } AppearingFrame.Content = mainStackLayout; ViewModel.IsBottomModelVisible = true; await AppearingFrame.TranslateTo(0, 0); }
private void HideFrame() { AppearingFrame.TranslateTo(0, Height + 100); ViewModel.IsBottomModelVisible = false; }