Back to Devexpress

BrowsePathEdit.DialogClosed Event

wpf-devexpress-dot-xpf-dot-editors-dot-browsepathedit-ad432d21.md

latest5.2 KB
Original Source

BrowsePathEdit.DialogClosed Event

Occurs when a user closes the browse dialog.

Namespace : DevExpress.Xpf.Editors

Assembly : DevExpress.Xpf.Core.v25.2.dll

NuGet Package : DevExpress.Wpf.Core

Declaration

csharp
public event EventHandler<DialogClosedEventArgs> DialogClosed
vb
Public Event DialogClosed As EventHandler(Of DialogClosedEventArgs)

Event Data

The DialogClosed event's data class is DialogClosedEventArgs. The following properties provide information specific to this event:

PropertyDescription
DialogResultGets whether a file/folder was selected in the dialog.
HandledGets or sets a value that indicates the present state of the event handling for a routed event as it travels the route. Inherited from RoutedEventArgs.
OriginalSourceGets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class. Inherited from RoutedEventArgs.
ReadOnlyCheckedGets whether the Open as read-only check box is checked.
RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance. Inherited from RoutedEventArgs.
SourceGets or sets a reference to the object that raised the event. Inherited from RoutedEventArgs.

The event data class exposes the following methods:

MethodDescription
InvokeEventHandler(Delegate, Object)When overridden in a derived class, provides a way to invoke event handlers in a type-specific way, which can increase efficiency over the base implementation. Inherited from RoutedEventArgs.
OnSetSource(Object)When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes. Inherited from RoutedEventArgs.

Remarks

The following code sample shows only a file name in the BrowsePathEdit when a user selects a file in the browse dialog:

xaml
<dxe:BrowsePathEdit ShowIcon="False" DialogClosed="OnDialogClosed">
csharp
using DevExpress.Xpf.Editors;
using System.IO;
// ...

void OnDialogClosed(object sender, DialogClosedEventArgs e) {
    if (e.DialogResult == true)
        ((BrowsePathEdit)e.Source).Text = Path.GetFileName(((BrowsePathEdit)e.Source).Text);
}
vb
Imports DevExpress.Xpf.Editors
Imports System.IO
' ...

Private Sub OnDialogClosed(ByVal sender As Object, ByVal e As DialogClosedEventArgs)
    If e.DialogResult = True Then (CType(e.Source, BrowsePathEdit)).Text = Path.GetFileName((CType(e.Source, BrowsePathEdit)).Text)
End Sub

See Also

DialogOpening

BrowsePathEdit Class

BrowsePathEdit Members

DevExpress.Xpf.Editors Namespace