// Token: 0x060004B4 RID: 1204 RVA: 0x0002050C File Offset: 0x0001E70C private static void OnIconChanged(BindableObject bindable, object oldValue, object newValue) { FuncView funcView = bindable as FuncView; if (!oldValue.Equals(newValue)) { funcView.image.Source = SvgImageSource.FromFile(newValue.ToString(), 0, 0, true, null); } }
// Token: 0x060004C1 RID: 1217 RVA: 0x00020B64 File Offset: 0x0001ED64 private static void OnIconChanged(BindableObject bindable, object oldValue, object newValue) { MineCell mineCell = bindable as MineCell; if (!oldValue.Equals(newValue)) { mineCell.icon.Source = SvgImageSource.FromFile(newValue.ToString(), 0, 0, true, null); } }
void tap(object sender, object e) { if (State) { SetValue(StateProperty, false); Image.Source = !string.IsNullOrEmpty(IconOff) ? SvgImageSource.FromFile(IconOff) : SvgImageSource.FromFile("more.svg"); } else { SetValue(StateProperty, true); Image.Source = !string.IsNullOrEmpty(IconOn) ? SvgImageSource.FromFile(IconOn) : SvgImageSource.FromFile("more.svg"); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { var str = parameter as string; if (!string.IsNullOrEmpty(str)) { var on = SvgImageSource.FromFile(str, vectorWidth: 36, vectorHeight: 36); return(on); } else { return(null); //Icon="{Binding ., Converter={x:Static converter:Converters.SvgToImageSourceConverter}, ConverterParameter='settings.svg'}" } }
protected override void OnPropertyChanged(string propertyName = null) { base.OnPropertyChanged(propertyName); if (propertyName == IconProperty.PropertyName) { if (Icon != null && Icon.EndsWith(".svg", StringComparison.OrdinalIgnoreCase)) { _image.Source = SvgImageSource.FromFile(Icon); } else { _image.Source = Icon; } } if (propertyName == IconWidthProperty.PropertyName || propertyName == IconHeightProperty.PropertyName) { _image.WidthRequest = IconWidth; _image.HeightRequest = IconHeight; WidthRequest = Math.Max(IconWidth, 36d); HeightRequest = Math.Max(IconHeight, 36d); } if (propertyName == IconSizeProperty.PropertyName) { if ((object)IconWidth != IconWidthProperty.DefaultValue) { _image.WidthRequest = IconSize; WidthRequest = Math.Max(IconSize, 36d); } if ((object)IconHeight != IconHeightProperty.DefaultValue) { _image.HeightRequest = IconSize; HeightRequest = Math.Max(IconSize, 36d); } } if (propertyName == CommandProperty.PropertyName) { (GestureRecognizers.First() as TapGestureRecognizer).Command = Command; } if (propertyName == CommandParameterProperty.PropertyName) { (GestureRecognizers.First() as TapGestureRecognizer).CommandParameter = CommandParameter; } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool == false) { return(default(ImageSource)); } var input = (bool)value; var result = input ? SvgImageSource.FromFile("svgdarkvoteup.svg") : SvgImageSource.FromFile("svgdarkvotedown.svg"); return(result); }
protected override void OnPropertyChanged(string propertyName = null) { base.OnPropertyChanged(propertyName); if (propertyName == StateProperty.PropertyName) { if (State) { Image.Source = !string.IsNullOrEmpty(IconOn) ? SvgImageSource.FromFile(IconOn) : SvgImageSource.FromFile("more.svg"); } else { Image.Source = !string.IsNullOrEmpty(IconOff) ? SvgImageSource.FromFile(IconOff) : SvgImageSource.FromFile("more.svg"); } } if (propertyName == IconOnProperty.PropertyName) { if (State) { Image.Source = !string.IsNullOrEmpty(IconOn) ? SvgImageSource.FromFile(IconOn) : SvgImageSource.FromFile("more.svg"); } } if (propertyName == IconOffProperty.PropertyName) { if (!State) { Image.Source = !string.IsNullOrEmpty(IconOff) ? SvgImageSource.FromFile(IconOff) : SvgImageSource.FromFile("more.svg"); } } if (propertyName == CommandProperty.PropertyName) { (GestureRecognizers.First() as TapGestureRecognizer).Command = Command; } if (propertyName == IconSizeProperty.PropertyName) { Image.WidthRequest = IconSize; WidthRequest = Math.Max(IconSize, 36d); Image.HeightRequest = IconSize; HeightRequest = Math.Max(IconSize, 36d); } }
public Footer() { Expanded = false; // Outter Frame OutterFrame = new Frame() { VerticalOptions = LayoutOptions.End, HorizontalOptions = LayoutOptions.Fill, HeightRequest = FooterExpandedHeight, CornerRadius = 0, Margin = 0, Padding = 0, BackgroundColor = ColorUtil.TileBackgroundColor }; OutterFrame.SetValue(Grid.RowProperty, 1); var settingsButton = new SvgCachedImage() { Source = SvgImageSource.FromFile("settings.svg"), HeightRequest = SizeUtil.FooterButtonIconSize, WidthRequest = SizeUtil.FooterButtonIconSize, Margin = new Thickness(SizeUtil.FooterButtonLeftRightMargin, SizeUtil.FooterButtonTopBottomMargin), HorizontalOptions = LayoutOptions.End, VerticalOptions = LayoutOptions.Center }; settingsButton.GestureRecognizers.Add(new TapGestureRecognizer() { Command = new Command((Sender) => { if (OutterFrame.AnimationIsRunning("opening")) { return; } double startingHeight, endingHeight = 0d; if (Expanded) { startingHeight = SizeUtil.FooterHeightExpanded; endingHeight = FooterExpandedHeight; } else { startingHeight = FooterExpandedHeight; endingHeight = SizeUtil.FooterHeightExpanded; } Action <double> callback = input => OutterFrame.HeightRequest = input; uint rate = 16; uint length = 500; Easing easing = Easing.CubicOut; OutterFrame.Animate("opening", callback, startingHeight, endingHeight, rate, length, easing); Expanded = !Expanded; }) }); OutterFrame.Content = new Grid() { VerticalOptions = LayoutOptions.Start, HeightRequest = FooterExpandedHeight, Children = { new Label() { Margin = new Thickness(SizeUtil.FooterButtonLeftRightMargin, SizeUtil.FooterButtonTopBottomMargin), Text = TextUtil.ApplicationName, FontSize = 12, TextColor = ColorUtil.PrimaryTextColor, HorizontalOptions = LayoutOptions.Center }, settingsButton, new SvgCachedImage() { Source = SvgImageSource.FromFile("info.svg"), HeightRequest = SizeUtil.FooterButtonIconSize, WidthRequest = SizeUtil.FooterButtonIconSize, Margin = new Thickness(SizeUtil.FooterButtonLeftRightMargin, 0), HorizontalOptions = LayoutOptions.Start, VerticalOptions = LayoutOptions.Center } } }; Content = OutterFrame; }
public TrackDragListView() { rootListView = new SfListView(); rootListView.SelectionMode = SelectionMode.None; rootListView.Padding = 0; rootListView.Margin = 0; rootListView.DragStartMode = DragStartMode.OnDragIndicator; rootListView.AutoFitMode = AutoFitMode.Height; rootListView.DragDropController.UpdateSource = true; rootListView.ItemTapped += ItemTapped; dataTemplate = new DataTemplate(() => { var _root = new Grid() { Padding = 0, Margin = new Thickness(10, 5, 10, 5), ColumnDefinitions = new ColumnDefinitionCollection() { new ColumnDefinition() { Width = GridLength.Auto }, new ColumnDefinition() { Width = GridLength.Star }, new ColumnDefinition() { Width = GridLength.Auto }, }, }; var _trackImage = new CachedImage() { HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, HeightRequest = 60d, WidthRequest = 60d, Aspect = Aspect.AspectFill, ErrorPlaceholder = "thumbnail_small.png", CacheType = FFImageLoading.Cache.CacheType.None, }; _trackImage.SetBinding(CachedImage.SourceProperty, new Binding("FilePath", converter: Converters.Converters.GetImageFromTrackConverter, converterParameter: "thumbnail_small.png")); var _labelRoot = new StackLayout { VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand, Orientation = StackOrientation.Vertical, Spacing = 0, }; var _labelTitle = new Label { FontSize = 14, TextColor = Colors.l_TextPrimary, Margin = new Thickness(5, 0, 5, 0), }; _labelTitle.SetBinding(Label.TextProperty, new Binding("Title")); var _labelSubTitle = new Label() { FontSize = 12, TextColor = Colors.l_TextSubItem, Margin = new Thickness(5, 0, 5, 0), }; _labelSubTitle.SetBinding(Label.TextProperty, new Binding("Artist")); var dragIndicatorView = new DragIndicatorView() { ListView = rootListView, Margin = new Thickness(5, 5, 5, 5), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Content = new CachedImage { HeightRequest = 35d, WidthRequest = 35d, Source = SvgImageSource.FromFile("more.svg"), VerticalOptions = LayoutOptions.Center, HorizontalOptions = LayoutOptions.Center, Aspect = Aspect.Fill, }, }; _labelRoot.Children.Add(_labelTitle); _labelRoot.Children.Add(_labelSubTitle); _root.Children.Add(_trackImage, 0, 0); _root.Children.Add(_labelRoot, 1, 0); _root.Children.Add(dragIndicatorView, 2, 0); return(_root); }); rootListView.ItemTemplate = dataTemplate; Content = rootListView; }