.

WPF file dialog

This is how you handle file dialogs in WPF:

<DockPanel Background="SkyBlue" LastChildFill="True" DockPanel.Dock="Top">
    <TextBlock Text="File:" Margin="5" DockPanel.Dock="Left" VerticalAlignment="Center" />
    <Button Content="..." Margin="5" DockPanel.Dock="Right " VerticalAlignment="Center" Width="22" Click="selectRepo" />
    <TextBox Name="TxtFile" Text="repo here" Margin="5" DockPanel.Dock="Left" VerticalAlignment="Center" />
</DockPanel>
private void selectRepo(object sender, RoutedEventArgs e)
{
    var fileDialog = new System.Windows.Forms.OpenFileDialog();
    var result = fileDialog.ShowDialog();
    switch (result)
    {
        case System.Windows.Forms.DialogResult.OK:
            var file = fileDialog.FileName;
            TxtFile.Text = file;
            TxtFile.ToolTip = file;
            break;
        case System.Windows.Forms.DialogResult.Cancel:
            break;
    }
}

What's your thoughts on this?

*

Protected by WP Anti Spam