public SideMenuViewCell() { icon = new TintedImage() { Opacity = TRANSPARENT, Margin = new Thickness(0, 0, 26, 0) }; title = new Label() { VerticalOptions = LayoutOptions.FillAndExpand, VerticalTextAlignment = TextAlignment.Center, FontSize = 20, Opacity = TRANSPARENT, TextColor = ColorForNormalText, }; MenuItem = new StackLayout() { Padding = new Thickness(16, 10), HorizontalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Horizontal }; View = MenuItem; MenuItem.Children.Add(icon); MenuItem.Children.Add(title); }
private Grid GetSingleDeleteButton() { var SingleDeleteBtn = new Grid(); SingleDeleteBtn.WidthRequest = 40; SingleDeleteBtn.HeightRequest = 40; ImageButton imageButton = new ImageButton(); SingleDeleteBtn.BackgroundColor = Color.Transparent; TintedImage tintedImage = new TintedImage(); tintedImage.Source = ImageSource.FromFile("baseline_remove_black_24"); tintedImage.TintColor = Color.White; tintedImage.InputTransparent = true; tintedImage.Margin = new Thickness(8); imageButton.BackgroundColor = Color.Black; imageButton.CornerRadius = 3; SingleDeleteBtn.Children.Add(imageButton); SingleDeleteBtn.Children.Add(tintedImage); SingleDeleteBtn.HorizontalOptions = LayoutOptions.CenterAndExpand; SingleDeleteBtn.VerticalOptions = LayoutOptions.Center; SingleDeleteBtn.Margin = new Thickness(10, 10, 15, 10); imageButton.Clicked += SingleDeleteButtonClicked; return(SingleDeleteBtn); }
void activateIcon(TintedImage icon) { if (icon.TintColor == null || icon.TintColor == Constants.PasiveColor) { icon.TintColor = Constants.ActiveOrangeColor; } else { icon.TintColor = Constants.PasiveColor; } }
private void SetTint(TintedImage element) { if (element.TintColor.Equals(Xamarin.Forms.Color.Transparent)) { if (Control.ColorFilter != null) { Control.ClearColorFilter(); } return; } var colorFilter = new PorterDuffColorFilter(element.TintColor.ToAndroid(), PorterDuff.Mode.SrcIn); Control.SetColorFilter(colorFilter); }
private void SetTint(TintedImage element) { if (Control?.Image == null || element == null) { return; } if (element.TintColor == Color.Transparent) { Control.Image = Control.Image?.ImageWithRenderingMode(UIImageRenderingMode.Automatic); Control.TintColor = null; } else { Control.Image = Control.Image?.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate); Control.TintColor = element.TintColor.ToUIColor(); } }
public void InizializeImage() { EmbeddedImage e = new EmbeddedImage(); e.Resource = "fondomerende.image.History.png"; var tinted = new TintedImage { Scale = 0.5, VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Aspect = Aspect.AspectFill, Source = e.Resource, }; tinted.TintColor = Color.FromHex(Preferences.Get("Colore", "#000000")); Griglia.Children.Add(tinted, 0, 0); }
void deactivateIcon(TintedImage icon) { icon.TintColor = Constants.PasiveColor; }
void activateIcon(TintedImage icon) { icon.TintColor = Constants.ActiveOrangeColor; }