示例#1
0
 private void IconSourceChanged()
 {
     if (m_iconPresenter != null)
     {
         m_iconPresenter.Child = IconSource.CreateIconElement();
     }
 }
        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));
        }
		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);
		}
示例#4
0
 private void UpdateIcon(IconSource iconSource)
 {
     pageIconSource = iconSource;
     DynamicInfoBadge.IconSource = iconSource;
 }