/// <summary> /// Set the icon of the library /// </summary> /// <param name="iconId">the Shell stock icon ID</param> public void SetIcon(int iconId) { using (ShellLibrary shellLibrary = ShellLibrary.Load(LibraryName, true)) { shellLibrary.Icon = Helper.GetIcon(iconId); ShellIcon = StockIcons.GetBitmapSource((StockIconIdentifier)iconId); } }
private void InsertIcons() { foreach (StockIconIdentifier iconId in Enum.GetValues(typeof(StockIconIdentifier))) { Image image = new Image(); image.Source = StockIcons.GetBitmapSource((StockIconIdentifier)iconId); Button button = new Button(); button.Content = image; button.Name = iconId.ToString(); button.Click += (s, e) => { _iconId = (int)Enum.Parse(typeof(StockIconIdentifier), ((Button)e.Source).Name); Close(); }; _wrapPanel.Children.Add(button); } }