private void RibbonButton_Click_1(object sender, RoutedEventArgs e) { Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog(); dlg.InitialDirectory = @"c:\"; dlg.Filter = "Image files (*.tif)|*.tif|All Files (*.*)|*.*"; dlg.RestoreDirectory = true; bool? result = dlg.ShowDialog(); if (dlg.ShowDialog == System.Windows.Forms.DialogResult.OK) { string selectedFileName = dlg.FileName; Label1.Content = selectedFileName; BitmapImage bitmap = new BitmapImage(); bitmap.BeginInit(); bitmap.UriSource = new Uri(selectedFileName); bitmap.EndInit(); Imageviewer1.Source = bitmap; }
if (result.HasValue && result.Value)
if (dlg.ShowDialog == System.Windows.Forms.DialogResult.OK)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)