コード例 #1
0
        private void TypePlaySongImage_Tapped(object sender, EventArgs e)
        {
            var viewModel = DataSource;

            switch (viewModel.TypePlayMusic)
            {
            case TYPE_PLAY_MUSIC.PLAY_REPEAT_ALL:
            {
                viewModel.TypePlayMusic  = TYPE_PLAY_MUSIC.PLAY_REPEAT_ONE;
                TypePlaySongImage.Source = SvgImageSource.FromResource("NuMusic.Resources.Svg.icon_play_repeat1.svg");
                break;
            }

            case TYPE_PLAY_MUSIC.PLAY_REPEAT_ONE:
            {
                viewModel.TypePlayMusic  = TYPE_PLAY_MUSIC.PLAY_RANDOM;
                TypePlaySongImage.Source = SvgImageSource.FromResource("NuMusic.Resources.Svg.icon_play_random.svg");
                break;
            }

            case TYPE_PLAY_MUSIC.PLAY_RANDOM:
            {
                viewModel.TypePlayMusic  = TYPE_PLAY_MUSIC.PLAY_REPEAT_ALL;
                TypePlaySongImage.Source = SvgImageSource.FromResource("NuMusic.Resources.Svg.icon_play_repeat.svg");
                break;
            }
            }
        }
コード例 #2
0
        private static void IconPropertyChanged(BindableObject bindable, object oldValue, object newValue)
        {
            var control = (CustomEntry)bindable;

            iconPath            = newValue.ToString();
            control.Icon.Source = SvgImageSource.FromResource(newValue.ToString());
        }
コード例 #3
0
ファイル: UI.cs プロジェクト: zauberzeug/InterfaceBuilder
 public virtual SvgCachedImage Svg(string ressourceId)
 {
     return new SvgCachedImage {
         Source = SvgImageSource.FromResource(ressourceId, FindCallingAssembly())
         //WidthRequest = 100,
         //HeightRequest = 100,
     };
 }
コード例 #4
0
ファイル: SvgImage.cs プロジェクト: tianvan/Loader
        private void OnSvgPathChanged()
        {
            if (SvgPath == null)
            {
                return;
            }

            var assemblyName      = GetType().Assembly.GetName().Name;
            var svgPathNormalized = SvgPath.Replace("/", ".");
            var svgFullPath       = $"{assemblyName}.{svgPathNormalized}";

            Source = SvgImageSource.FromResource(svgFullPath);
        }
コード例 #5
0
        private void PlaySongImage_Tapped(object sender, EventArgs e)
        {
            var viewModel = DataSource;
            var isPlaying = viewModel.IsPlayingMusic;

            viewModel.IsPlayingMusic = !isPlaying;
            if (viewModel.IsPlayingMusic)
            {
                _animation.Start();
                PlaySongImage.Source = SvgImageSource.FromResource("NuMusic.Resources.Svg.icon_play.svg");
            }
            else
            {
                _animation.Stop();
                PlaySongImage.Source = SvgImageSource.FromResource("NuMusic.Resources.Svg.icon_pause.svg");
            }
        }
コード例 #6
0
        public SvgReplacePageModel()
        {
            ReplaceCommand = new BaseCommand((arg) =>
            {
                var r = _random.Next(256);
                var g = _random.Next(256);
                var b = _random.Next(256);

                ReplaceMap = new Dictionary <string, string>()
                {
                    { "#TEXT", Guid.NewGuid().ToString() },
                    { "#FILLCOLOR", $"#{r:X2}{g:X2}{b:X2}" }
                };

                ImageSource = SvgImageSource.FromResource("FFImageLoading.Forms.Sample.Resources.replace.svg",
                                                          replaceStringMap: ReplaceMap);
            });

            ReplaceCommand.Execute(null);
        }
コード例 #7
0
ファイル: ResourceLoader.cs プロジェクト: webprofusion/scalex
        public SvgImageSource GetSVGImageResource(string img)
        {
            var res = FetchResource(img);

            return(SvgImageSource.FromResource(res.Item1, res.Item2));
        }
コード例 #8
0
        private static void UpdateSvg(BindableObject bindable, object oldVal, object newVal)
        {
            var _instance = bindable as TintedCachedImage;

            _instance.Source = SvgImageSource.FromResource((string)newVal);
        }