private void OpenDrive(object sender, MouseButtonEventArgs e)
{
if (e.ClickCount < 2) return;
StackPanel panel = (StackPanel) sender;
string path = "";
foreach (
var textBlock in
panel.Children.OfType<FrameworkElement>().Where(child => child.Name == "Path").OfType<TextBlock>())
{
path = textBlock.Text;
}
var view = new ExploreView();
view.FillView(path);
var parentWindow = (MainWindow) Window.GetWindow(this);
if (parentWindow == null) return;
var tab = (TabItem) parentWindow.tabDynamic.SelectedItem;
tab.Header = path; // because it won't be too long. I hope...
tab.Content = view;
}