private void BrowseSource() { OpenFileDialog openDialog = new OpenFileDialog(); openDialog.Title = "Select a Tileset"; openDialog.InitialDirectory = this.session.LastTilesetDirectory.Value; openDialog.Filter = ImageExtension.GetOpenFileImageExtensions(); if (openDialog.ShowDialog() == true) { string tileFilePath = openDialog.FileName; if (File.Exists(tileFilePath)) { this.IsSourceLoaded.Value = true; this.SourcePath.Value = tileFilePath; this.session.LastTilesetDirectory.Value = Directory.GetParent(tileFilePath).FullName; MatReader reader = new MatReader(); ResourceLoader loader = ResourceLoader.Instance; Mat toLoad = loader.Load <Mat>(tileFilePath, reader); LoadItemImage(toLoad); } } }