command

WPF: How to redefine CanExecute method of ApplicationCommands

I use standard Cut, Copy and Paste commands (which is part of ApplicationCommands class). Is it possible to redefine CanExecute method? Here is my code: XAML: <Window.CommandBindings> <CommandBinding Command="Copy" CanExecute="CopyCanExecute" Executed="CopyExecuted"/> </Window.CommandBindings> ...

How can I tie a WPF Command to a MouseEnter event?

I need to tie a WPF-Command to the MouseEnter event of a Stackpanel. How can I do that? ...

WPF Using commands to slow to update UI controls

Hi, I bind a command to a button through command property and doing a command binding in the page it is placed. In execute method I create an instance of a class that contains the background worker and I start it (this is a long task). The background worker (bw) class contains a variable isRunning that it is set to true before DoWork me...

Adding programatically a command to a listbox in WPF

In my WPF application there is a listbox with items. The listbox is populated via a xmldataprovider from XAML and then binding it to Itemssource property of the listbox. Well, from XAML, I bind a comand to the listbox by doing: <ListBox.CommandBindings> <CommandBinding ...

How to change button background color depending on bound command canexecute ??

Hi, I Have a ItemTemplate in which is a simple button bound on a command, which can be executable or not depending on some property. I'd like the color of this button's background to change if the command isn't executable. I tried several methods, but I can't find anyway to do this purely in XAML (I'm doing this in a study context, and...

how to check if the OS is Windows or Debian in c++?

I want to clear console screen every time the user make an input in C++. I'm thinking of using system command. For Windows, it is "cls". For Linux, it is "clear". Is there a way check which system to use the appropriate command in c++? Thanks. ...

Need to copy remotely hosted file via Shell Command

There is a file that hosted remotely on a server that is not supporting Shell Access. I bought a new server that supports Shell Access so now I want to copy a file that is on the non-supporting server to new server via a Shell Command using Putty. The file URL is like this http://www.domain.com/file.gzip and it is username/password prot...

WPF: Copy Property to Clipboard

I have a string property in my ViewModel/Datacontext and want a simple button that copies its contents to the clipboard. Is this possible to do from XAML, or I do I need to handle the button click event (or use an ICommand) to accomplish this? I thought the following would work, but my button is always greyed out: <Button Width="1...

How do I get a Mac ".command" file to automatically quit after running a shell script?

In my shell script, my last lines are: ... echo "$l" done done exit I have Terminal preference set to "When the shell exits: Close the window". In all other cases, when I type "exit" or "logout", in Terminal, the window closes, but for this ".command" file (I can double-click on my shell script file, and the script runs), instead of...

MFC resource.h command/message IDs

Hi I'm working on an MFC application, that got pretty messy over years and over different teams of developers. The resource.h file, which contains all command/message mappings grew pretty big over time, and has lots of problems (like duplicate IDs). I am not proficient with MFC, so the question might sound pretty stupid... MSDN docs me...

Running Command via Java ProccesBuilder Different to Running the same in the Shell

I'm tearing my hair out trying to work out why the command I'm executing via Java using a ProcessBuilder & Process is not working. I run the "same" command at the Windows command line and it works as expected. It must be that they're not the same but I can't for the life of me work out why. The command is this: ccm start -nogui -m -q -...

Implementing custom CanExecuteChanged event with Commands in WPF

Hi everybody, I try to do a custom CanExecuteChanged event for a command button. Inside CanExecuteChanged event I would like to do some stuff when canExecute value change but I don't want to do it by implementing a custom command button class (deriving from Button and Implementing ICommandSource). Also I don't want to do my stuff into C...

WPF ViewModel Commands CanExecute issue

Hi all, I'm having some difficulty with Context Menu commands on my View Model. I'm implementing the ICommand interface for each command within the View Model, then creating a ContextMenu within the resources of the View (MainWindow), and using a CommandReference from the MVVMToolkit to access the current DataContext (ViewModel) Command...

How do I launch a WPF app from command.com. I'm getting a FontCache error.

I know this is not ideal, but my constraint is that I have a legacy application written in Clipper. I want to launch a new, WinForms/WPF application from inside the application (to ease transition). This legacy application written in Clipper launches using: SwpRunCmd("C:\MyApp\MyBat.bat",0) The batch file contains something like thi...

WPF relaycommand from usercontrol

Hi, I'm new to WPF and in the spirit of trying to do things the correct way have tried to implement MVVM in my application. I've made use of the frequently mentioned article by Josh Smith, and apart from making me realise how little I know, it has left me a little stumped. Specifically, I have a page that uses the RelayCommand object t...

Do FormViews not respond to commands issued from an ImageButton?

I am using ImageButtons in place of LinkButtons in a FormView to issue New/Edit/Delete/Cancel commands, but they don't seem to have an effect on the FormView. The ImageButtons will cause a postback but the FormView mode doesn't change from the current mode. I'm sure the ImageButtons were working at one point, but I've been busy with ot...

How to stop my network connection on WinXP using batch command?

for example, if I want to stop "lan connection 1" in my control pannel, I usually right click it in my control panel and disable it. Now I want to write a script to disable and enable those connections. How can I do it?? Thank you very much ...

Commands to compile programs on Windows

In case I have .NET framework installed in my computer + all the necessary other language support (Perl Interpreter, etc) What are the commands I should give in the console to compile programs in the following languages: 1. C 2. C++ 3. Java 4. Python 5. VB 6. C# 7. Perl 8. Ruby Like we have for VB- *vbc program_name.vb*, what are the c...

how to call a program from python without waiting for it to return

is there a way to call a program from python without waiting for it to return? i created a script which copies a program to a directory and runs that program. but when i call the program from python, the python script does not exit until the program i launched exits. i have tried os.system and Popen. is there another way to do this? Add...

an emacs command to open a new instance of emacs

How can I make a cross-platform emacs command that opens another instance of emacs with -q option? The reason why I need such a command is that it would be easy to modify the command to make it open another instance of emacs with -q and -l option so that the new instance loads an el file that I am editing with the old instance. ...