public MainWindow() { InitializeComponent(); if (File.Exists("baseMtpDevice.xml")) { DefaultDeviceInfo = XmlDeviceData.Load("baseMtpDevice.xml"); } }
private void MenuItem_Click_2(object sender, RoutedEventArgs e) { try { OpenFileDialog dialog = new OpenFileDialog(); dialog.Filter = "Xml file (*.xml)|*.xml"; if (dialog.ShowDialog() == true) { DeviceInfo = XmlDeviceData.Load(dialog.FileName); } InitUi(); } catch (Exception exception) { MessageBox.Show("Error loading file " + exception.Message); } }