/// <summary> /// Occurs when the icon of a display changes. /// </summary> /// <param name="d">DependencyObject</param> /// <param name="e">DependencyPropertyChangedEventArgs</param> private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { var iconDisplay = d as IconDisplay; if (iconDisplay != null) { iconDisplay.Text = MainMenuIconConverter.GetIconCode((MainMenuIcon)e.NewValue); } }
/// <summary> /// Initializes a new editable tree view item. /// </summary> /// <param name="parent">Parent of item.</param> /// <param name="file">The file for this tree itme.</param> public FileTreeViewItem(ModelTreeViewItem parent, FileInfo file) : base(parent, false) { this.File = file; this.Text = file.Name; this.IsDirectory = false; this.Icon = MainMenuIconConverter.GetIconForFile(file); if ((file.Attributes & FileAttributes.Hidden) != 0) { this.IconBrush = MainMenuIconConverter.GetIconBrushForFile(file).Clone(); this.IconBrush.Opacity = 0.7; this.IconBrush.Freeze(); } else { this.IconBrush = MainMenuIconConverter.GetIconBrushForFile(file); } }