コード例 #1
0
        private static void ChangeSource(DependencyObject obj, DependencyPropertyChangedEventArgs r)
        {
            FileExplorerView fileView = (FileExplorerView)obj;

            if (fileView.fileListControl.DirectoryPath == null || fileView.fileListControl.DirectoryPath != (string)r.NewValue)
            {
                fileView.Source = (string)r.NewValue;
                fileView.fileListControl.Navigate(fileView.Source);
            }
        }
コード例 #2
0
        private void OpenSpecialFolder_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            SpecialFolderInfo specialFolderInfo = e.Parameter as SpecialFolderInfo;

            HandyControl.Controls.TabItem tabItem2 = new HandyControl.Controls.TabItem();
            tabItem2.Header = specialFolderInfo.FolderPath;
            FileExplorerView fileExplorerView = new FileExplorerView();

            tabItem2.Content = fileExplorerView;
            fileExplorerView.Navigate(specialFolderInfo.FolderPath);
            tabControl.Items.Add(tabItem2);
            tabControl.SelectedIndex = tabControl.Items.Count - 1;//选择最后一个
        }
コード例 #3
0
        private void OpenLocalDriverCommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            LocalDriveInfo driveInfo = e.Parameter as LocalDriveInfo;

            HandyControl.Controls.TabItem tabItem2 = new HandyControl.Controls.TabItem();
            tabItem2.Header = driveInfo.Name;
            FileExplorerView fileExplorerView = new FileExplorerView();

            tabItem2.Content = fileExplorerView;
            fileExplorerView.Navigate(driveInfo.Name);
            tabControl.Items.Add(tabItem2);
            tabControl.SelectedIndex = tabControl.Items.Count - 1;//选择最后一个
        }