command

How can I realize SelectionChanged in MVVM ListBox Silverlight

主宰稳场 提交于 2019-12-19 03:14:35
问题 The ListBox control does not implement a Command property. I have to attach some functionality to the SelectionChanged event. Somebody knows how can I do it? Please help me 回答1: I prefer using a binding to the SelectedItem and implementing any functionality in the setting of the binding property. <ListBox ItemsSource="{Binding Items}" SelectedItem="{Binding SelectedItem}" /> ... public class ViewModel { public IEnumerable<Item> Items { get; set; } private Item selectedItem; public Item

Emacs M-x commands for invoking “GUI-style” menus

人走茶凉 提交于 2019-12-18 21:29:10
问题 Question: How could I find out the M-x equivalent commands for doing GUI-based operations in Emacs, in those cases where my Emacs-variant uses OS-specific desktop functionality? Background: Conventional understanding states that everything in Emacs is a command, and that commands can be invoked via M-x, as long as you know the name of the command. Assuming this statement is correct, what is the way to find the name of the commands used to trigger the "GUI-style" menus in a "desktop" based

Communicate With Command Prompt Through Delphi

一世执手 提交于 2019-12-18 17:16:13
问题 I have tried to use delphi to send commands to the command prompt. However, i am not able to do so as i used CreateProcess method to do it. I have tried to change the StdOutPipeWrite, however, the CreateProcess seems to not allow commands after the initial command from CreateProcess to be passed through. Is there any way to make use of the handle to continue to send and receive commands and messages to and fro the command prompt and delphi? 回答1: My fellow member Glenn9999 from tek-tips.com

Open file from complete path under cursor in Vim

て烟熏妆下的殇ゞ 提交于 2019-12-18 16:53:28
问题 If I have a file that contains a complete path for a file, is there a way to highlight the filename (using visual mode) and open the file (preferably in a split screen)? Here is the behavior I would like: if the file name contains a / character, assume it is a full path (i.e. the current directory is root). Otherwise, use the current folder (i.e. default behavior). Is this possible? 回答1: Put the cursor on the filename and type gf (in command mode). Or use CTRL + W | CTRL + F to open in

Run a command shell in jenkins

人盡茶涼 提交于 2019-12-18 14:03:17
问题 I'm trying to execute a command shell in Jenkins, I'm working on Windows 7. In the console output I have this: Building in workspace C:\Program Files (x86)\Jenkins\workspace\test [test] $ sh -xe C:\Windows\TEMP\hudson6299483223982766034.sh The system cannot find the file specified FATAL: L'exécution de la commande a échoué. java.io.IOException: Cannot run program "sh" (in directory "C:\Program Files (x86)\Jenkins\workspace\test"): CreateProcess error=2, Le fichier spécifié est introuvable at

Binding WPF ContextMenu MenuItem to UserControl Property vs ViewModel Property

丶灬走出姿态 提交于 2019-12-18 13:39:44
问题 I'm struggling to understand what is going on with the ContextMenu. I know it is rendered as a separate window, with a separate visual tree, so we can't use relative binding to bind a command exposed as a property of the user control. e.g. the following does not work: <MenuItem Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=TestCommand}" Header="Test" /> But, if you set the data context of the user control to a view model that exposes a command as a property,

Binding WPF ContextMenu MenuItem to UserControl Property vs ViewModel Property

好久不见. 提交于 2019-12-18 13:39:39
问题 I'm struggling to understand what is going on with the ContextMenu. I know it is rendered as a separate window, with a separate visual tree, so we can't use relative binding to bind a command exposed as a property of the user control. e.g. the following does not work: <MenuItem Command="{Binding RelativeSource={RelativeSource AncestorType=UserControl}, Path=TestCommand}" Header="Test" /> But, if you set the data context of the user control to a view model that exposes a command as a property,

Context Menu items command binding WPF using MVVM

依然范特西╮ 提交于 2019-12-18 13:35:30
问题 I know this question has been asked many times in different ways in many websites and also in StackOverFlow but all the answers I found are not helping me ot to be precise I am not able to understand them and implement in my application. So I thought of putting some code from my application so that you people can help me better. Problem Statement : I am using a WPF DataGrid. I have added a Context Menu and I have 3 options Cut,Copy,Paste. I am using MVVM for development. I want to DataBind

WPF: TreeViewItem bound to an ICommand

旧巷老猫 提交于 2019-12-18 13:19:37
问题 I am busy creating my first MVVM application in WPF. Basically the problem I am having is that I have a TreeView (System.Windows.Controls.TreeView) which I have placed on my WPF Window, I have decide that I will bind to a ReadOnlyCollection of CommandViewModel items, and these items consist of a DisplayString, Tag and a RelayCommand. Now in the XAML, I have my TreeView and I have successfully bound my ReadOnlyCollection to this. I can view this and everything looks fine in the UI. The issue

Executing a Command from Java and Waiting for the Command to Finish

非 Y 不嫁゛ 提交于 2019-12-18 13:19:29
问题 In my Java program, I create a process that executes a command to run a batch file like this: try { File tempFile = new File("C:/Users/Public/temp.cmd"); tempFile.createNewFile(); tempFile.deleteOnExit(); setContents(tempFile, recipe.getText()); //Writes some user input to file String cmd = "cmd /c start " + tempFile.getPath(); Process p = Runtime.getRuntime().exec(cmd); int exitVal = p.waitFor(); refreshActionPerformed(evt); } catch (InterruptedException ex) { Logger.getLogger(mainFrame