Exemplo n.º 1
0
 private void IconSourceChanged()
 {
     if (m_iconPresenter != null)
     {
         m_iconPresenter.Child = IconSource.CreateIconElement();
     }
 }
Exemplo n.º 2
0
        public Task <Microsoft.UI.Xaml.Controls.IconSource> LoadIconSourceAsync(ImageSource imagesource, CancellationToken cancellationToken = default(CancellationToken))
        {
            Microsoft.UI.Xaml.Controls.IconSource image = null;

            if (imagesource is FileImageSource filesource)
            {
                UpdateImageDirectory(filesource);
                string file = filesource.File;
                image = new Microsoft.UI.Xaml.Controls.BitmapIconSource {
                    UriSource = new Uri("ms-appx:///" + file)
                };
            }

            return(Task.FromResult(image));
        }
Exemplo n.º 3
0
		public Task<Microsoft.UI.Xaml.Controls.IconSource> LoadIconSourceAsync(ImageSource imagesource, CancellationToken cancellationToken = default(CancellationToken))
		{
			Microsoft.UI.Xaml.Controls.IconSource image = null;

			if (imagesource is FontImageSource fontImageSource)
			{
				image = new WFontIconSource
				{
					Glyph = fontImageSource.Glyph,
					FontSize = fontImageSource.Size,
					Foreground = fontImageSource.Color.ToBrush()
				};

				var uwpFontFamily = fontImageSource.FontFamily.ToFontFamily();

				if (!string.IsNullOrEmpty(uwpFontFamily.Source))
					((WFontIconSource)image).FontFamily = uwpFontFamily;
			}

			return Task.FromResult(image);
		}
Exemplo n.º 4
0
 private void UpdateIcon(IconSource iconSource)
 {
     pageIconSource = iconSource;
     DynamicInfoBadge.IconSource = iconSource;
 }