private void Initialize() { MainWindow = new StudioWindow(this); _mainSite = MainWindow.MainSite; // Initialize Composition Host Host.InitiailizeComposition(this); // Initialize main sites MainSiteManager.Instance().InitializeMainSite(this); // Initialize left panels LeftPanelManager.Instance().InitializeLeftPanels(this, MainWindow.LeftPanelsContainer); MainWindow.Show(); }
public FileSystemTreeViewer(ILeftPanel fileSystemTreePanel) { InitializeComponent(); var directories = FileSystemUtilities.GetRootDirectories(); TreeViewer.DataContext = directories; _fileSystemTreePanel = fileSystemTreePanel; var fileItemsViewModel = new FileItemsViewModel(); MainSiteManager.Instance().SetVisibleSite(_fileSystemTreePanel.MainSite); (_fileSystemTreePanel.MainSite.RootFrameworkElement as FileItemsView).SetDataContext(fileItemsViewModel); FileBrowserHistory.PushBackHistory(String.Empty); }
/// <summary> /// Double click on tree view item /// </summary> /// <param name="sender"></param> /// <param name="args"></param> public void OnDirectoryDoubleClicked(object sender, MouseButtonEventArgs args) { var currentItem = sender as TreeViewItem; if (!currentItem.IsSelected) { return; } var selectedDirectory = currentItem.DataContext as DirectoryRecordViewModel; var fileItemsViewModel = new FileItemsViewModel(selectedDirectory.DirectoryRecord); MainSiteManager.Instance().SetVisibleSite(_fileSystemTreePanel.MainSite); (_fileSystemTreePanel.MainSite.RootFrameworkElement as FileItemsView).SetDataContext(fileItemsViewModel); FileBrowserHistory.PushBackHistory(selectedDirectory.DirectoryRecord.Info.FullName); args.Handled = true; }
private void InitializeSelectedPanel(object sender, SelectionChangedEventArgs args) { _selectedPanel = _leftPanels.ElementAt((sender as TabControl).SelectedIndex).Value; MainSiteManager.Instance().SetVisibleSite(_selectedPanel.MainSite); }