.

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;
    }
}

Using a Timer (DispatcherTimer) in WPF

var dispatcherTimer = new System.Windows.Threading.DispatcherTimer();
dispatcherTimer.Tick += new EventHandler(dispatcherTimer_Tick);
dispatcherTimer.Interval = new TimeSpan(0,5,0);
dispatcherTimer.Start();

private void dispatcherTimer_Tick(object sender, EventArgs e)
{
  // your code goes here
}

Dispatcher.BeginInvoke (invokeRequired equivalent for WPF)

public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void button_Click(object sender, RoutedEventArgs e)
        {
            Timer t = new Timer(1000);
            t.Elapsed += new ElapsedEventHandler(t_Elapsed);
            t.Start();
        }

        void TimerAction(object sender, EventArgs e)
        {
            if (image1.Dispatcher.Thread == System.Threading.Thread.CurrentThread)
            {
                image1.Visibility = (image1.Visibility == System.Windows.Visibility.Hidden ? System.Windows.Visibility.Visible : System.Windows.Visibility.Hidden);
            }
            else
            {
                image1.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
                    new EventHandler<EventArgs>(TimerAction), sender, new object[] { e });
            }
        }

        void t_Elapsed(object sender, ElapsedEventArgs e)
        {
            TimerAction(null, null);
        }

    }