예제 #1
0
 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();
 }
예제 #2
0
        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);
        }
예제 #3
0
        /// <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;
        }
예제 #4
0
 private void InitializeSelectedPanel(object sender, SelectionChangedEventArgs args)
 {
     _selectedPanel = _leftPanels.ElementAt((sender as TabControl).SelectedIndex).Value;
     MainSiteManager.Instance().SetVisibleSite(_selectedPanel.MainSite);
 }