Back to Devexpress

BrowsePathEdit.PathIconSelector Property

wpf-devexpress-dot-xpf-dot-editors-dot-browsepathedit-4c1414e2.md

latest2.5 KB
Original Source

BrowsePathEdit.PathIconSelector Property

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

Declaration

csharp
public IPathIconSelector PathIconSelector { get; set; }
vb
Public Property PathIconSelector As IPathIconSelector

Property Value

TypeDescription
DevExpress.Xpf.Editors.IPathIconSelector

The selector that allows you to choose a path icon based on custom logic.

|

Remarks

The following code sample changes the icon displayed for folders:

xaml
<Window.Resources>
    <local:IconSelector x:Key="iconSelector"/>
</Window.Resources>

<!-- ... -->

<dxe:BrowsePathEdit DialogType="Folder" PathIconSelector="{StaticResource iconSelector}">
csharp
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;
    }
}
vb
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

ShowIcon

PathIcon

BrowsePathEdit Class

BrowsePathEdit Members

DevExpress.Xpf.Editors Namespace