private void btnLoadFile_Click(object sender, RoutedEventArgs e) { OpenFileDialog ofd = new OpenFileDialog(); ofd.Title = "Load MSR Profile Data (Binary Mercury Steam Save)"; ofd.FileName = "common.bmssv"; ofd.Filter = "Binary Mercury Steam Save|common.bmssv"; ofd.Multiselect = false; if (ofd.ShowDialog() == true) { bmssvFile = BMSSVFile.Open(ofd.FileName); inventory.LoadData(bmssvFile); if (inventory.Visibility != Visibility.Visible) { inventory.Visibility = Visibility.Visible; } if (btnSaveFileAs.Visibility != Visibility.Visible) { btnSaveFileAs.Visibility = Visibility.Visible; } } }
private void LoadFile() { OpenFileDialog ofd = new OpenFileDialog() { Filter = "BMSSV Files|*.bmssv", Title = "Choose BMSSV . . .", RestoreDirectory = true }; if (ofd.ShowDialog() == true) { BMSSVFile bmssv = BMSSVFile.Open(ofd.FileName); LoadedFile = FileModel.FromBMSSV(bmssv); //this.DataContext = LoadedFile; } }