private void Search_OnClick(object sender, RoutedEventArgs e)
{
var ofd = new OpenFileDialog()
{
FileName = "Select Folder.",
InitialDirectory = PathTextBox.Text,
ValidateNames = false,
CheckFileExists = false,
CheckPathExists = false
};
if (ofd.ShowDialog(this) != true)
{
return;
}
PathTextBox !.Text = Path.GetDirectoryName(ofd.FileName) ?? "";
PathTextBox.GetBindingExpression(TextBox.TextProperty)?.UpdateSource();
}