wpf-devexpress-dot-xpf-dot-editors-dot-browsepathedit-4c1414e2.md
Gets or sets the selector that allows you to choose a path icon based on custom logic. This is a dependency property.
Namespace : DevExpress.Xpf.Editors
Assembly : DevExpress.Xpf.Core.v25.2.dll
NuGet Package : DevExpress.Wpf.Core
public IPathIconSelector PathIconSelector { get; set; }
Public Property PathIconSelector As IPathIconSelector
| Type | Description |
|---|---|
| DevExpress.Xpf.Editors.IPathIconSelector |
The selector that allows you to choose a path icon based on custom logic.
|
The following code sample changes the icon displayed for folders:
<Window.Resources>
<local:IconSelector x:Key="iconSelector"/>
</Window.Resources>
<!-- ... -->
<dxe:BrowsePathEdit DialogType="Folder" PathIconSelector="{StaticResource iconSelector}">
using DevExpress.Xpf.Editors;
using System.IO;
using System.Windows.Media;
using System.Windows.Media.Imaging;
// ...
public class IconSelector : IPathIconSelector {
public ImageSource Select(string path) {
if (Directory.Exists(path))
return new BitmapImage(new System.Uri("pack://application:,,,/Open_16x16.png"));
return null;
}
}
Imports DevExpress.Xpf.Editors
Imports System.IO
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
' ...
Public Class IconSelector
Inherits IPathIconSelector
Public Function [Select](ByVal path As String) As ImageSource
If Directory.Exists(path) Then Return New BitmapImage(New System.Uri("pack://application:,,,/Open_16x16.png"))
Return Nothing
End Function
End Class
See Also