private void GenerateNullData(FileExplorerItemViewModel selectedItem) { DataPanel.Children.Clear(); DataPanel.Children.Add(new TextBlock { Inlines = { new Run { Text = "Name: ", FontWeight = FontWeights.Bold }, new Run { Text = selectedItem.Filename }, new LineBreak() }, TextWrapping = TextWrapping.Wrap }); }
public FileExplorerStructureDeisgnModel() { Items = new ObservableCollection <FileExplorerItemViewModel>(); var newItem = new FileExplorerItemViewModel("C:\\", FileExplorerItemType.Drive, "C:\\"); newItem.Children = new ObservableCollection <FileExplorerItemViewModel> { new FileExplorerItemViewModel("C:\\Test Folder", FileExplorerItemType.Folder, "Test Folder"), new FileExplorerItemViewModel("C:\\Test Folder2", FileExplorerItemType.Folder, "Test Folder2"), new FileExplorerItemViewModel("C:\\Test File", FileExplorerItemType.File, "Test File") }; newItem.IsExpanded = true; Items.Add(newItem); newItem = new FileExplorerItemViewModel("B:\\", FileExplorerItemType.Drive, "B:\\"); newItem.Children = new ObservableCollection <FileExplorerItemViewModel> { new FileExplorerItemViewModel("B:\\Test Folder", FileExplorerItemType.Folder, "Test Folder"), new FileExplorerItemViewModel("B:\\Test Folder2", FileExplorerItemType.Folder, "Test Folder2"), new FileExplorerItemViewModel("B:\\Test File", FileExplorerItemType.File, "Test File"), new FileExplorerItemViewModel("B:\\Test File", FileExplorerItemType.File, "Test File"), new FileExplorerItemViewModel("B:\\Test File", FileExplorerItemType.File, "Test File"), new FileExplorerItemViewModel("B:\\Test File", FileExplorerItemType.File, "Test File"), new FileExplorerItemViewModel("B:\\Test File", FileExplorerItemType.File, "Test File") }; newItem.IsExpanded = true; Items.Add(newItem); newItem = new FileExplorerItemViewModel("Folder\\", FileExplorerItemType.Drive, "Folder"); newItem.Children = new ObservableCollection <FileExplorerItemViewModel> { new FileExplorerItemViewModel("Folder\\Test Folder", FileExplorerItemType.Folder, "Test Folder"), new FileExplorerItemViewModel("Folder\\Test Folder2", FileExplorerItemType.Folder, "Test Folder2"), new FileExplorerItemViewModel("Folder\\Test File", FileExplorerItemType.File, "Test File") }; newItem.IsExpanded = true; Items.Add(newItem); }
//Todo: Change to support multiple file types (peg, packfile, zone file, etc) private void GenerateDataView(FileExplorerItemViewModel selectedItem) { //Ensure file is loaded and read so panel info is available on first open if (selectedItem.File == null) { selectedItem.GetCacheFile(true, true); } string extension = Path.GetExtension(selectedItem.Filename); DataPanel.Children.Clear(); if (extension == ".vpp_pc") { var packfile = selectedItem.File?.PackfileData; if (packfile == null) { GenerateNullData(selectedItem); } else { GeneratePackfileData(packfile); } } else if (extension == ".str2_pc") { var container = selectedItem.File?.PackfileData; if (container == null) { GenerateNullData(selectedItem); } else { GeneratePackfileData(container); } } else if (extension == ".asm_pc") { var asmData = selectedItem.File?.AsmData; if (asmData == null) { GenerateNullData(selectedItem); } else { GenerateAsmData(asmData); } } else if (extension == ".cpeg_pc" || extension == ".cvbm_pc") { var pegData = selectedItem.File?.PegData; if (pegData == null) { GenerateNullData(selectedItem); } else { GenerateTextureData(pegData); } } else if (extension == ".rfgzone_pc") { GenerateNullData(selectedItem); } else if (extension == ".layer_pc") { GenerateNullData(selectedItem); } else if (extension == ".scriptx") { GenerateNullData(selectedItem); } }
public SelectedItemChangedEventArgs(FileExplorerItemViewModel selectedItem) { SelectedItem = selectedItem; }
public OpenFileEventArgs(FileExplorerItemViewModel targetItem) { TargetItem = targetItem; }