/// <summary> /// Вызов контекстного меню /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void openContextMenu(object sender, KeyEventArgs e) { if (e.Key == Key.Enter) { //Логика выбора контекстного меню ContextMenu cm = null; if (data.getPathFromBuffer() == "" && data.getFileType() == "directory") { cm = FolderView.FindResource("folder") as ContextMenu; } else if (data.getPathFromBuffer() == "" && data.getFileType() == "file") { cm = FolderView.FindResource("File") as ContextMenu; } else if (data.getPathFromBuffer() != "" && data.getFileType() == "directory") { cm = FolderView.FindResource("folderCopied") as ContextMenu; } else if (data.getPathFromBuffer() != "" && data.getFileType() == "file") { cm = FolderView.FindResource("FileCoppied") as ContextMenu; } if (cm != null) { //Вызов cm.IsOpen = true; } } else { Functional(sender, e); } }