You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
namespaceFluentTest;usingSystem;usingSystem.Collections.Generic;usingSystem.Collections.ObjectModel;usingSystem.Linq;usingSystem.Windows;usingSystem.Windows.Media;/// <summary>/// Browse the design time collection of icons in the Resource Dictionary/// </summary>publicpartialclassIconViewer{publicIconViewer(){}}publicclassDesignTimeData{publicObservableCollection<KeyValuePair<string,DrawingImage>>Data{get;set;}publicDesignTimeData(){ResourceDictionarydictionary=newResourceDictionary{Source=newUri("pack://application:,,,/Fluent;component/Themes/Images.xaml",UriKind.Absolute)};varkeys=dictionary.Keys.Cast<string>().Select(key =>key?.Substring(key.LastIndexOf('.')+1)).ToArray();varimages=dictionary.Values.Cast<DrawingImage>().ToArray();this.Data=newObservableCollection<KeyValuePair<string,DrawingImage>>();for(vari=0;i<dictionary.Count;i++){this.Data.Add(newKeyValuePair<string,DrawingImage>(keys[i],images[i]));}}}
Fluent.Ribbon\Themes\Generic.xaml - here we need to add Images.xaml for using Uri in the code above
I made a small image collection viewer for Fluent.Ribbon.Showcase that looks something like this:
This would make it easier to pick up any image and fill the collection.
Can you include this in your project if you find it useful?
Fluent.Ribbon.Showcase/IconViewer.xaml
Fluent.Ribbon.Showcase\IconViewer.xaml.cs
Fluent.Ribbon\Themes\Generic.xaml - here we need to add Images.xaml for using Uri in the code above
The text was updated successfully, but these errors were encountered: