WPF Trigger command - wpf

I know in Silverlight there is a concept of behaviours.
In WPF we have Triggers,
What I am trying to achieve is that when a user has his mouse over a button, I want a command to be fired.
I have a RepeatButton that has its Command Property set, but I want that command (or preferable another command to fire) when the mouse is over that button.Is this possible in WPF.
The Button is in a Control Template.
Thanks

Answer

Related

How to make an input-popup (popup dialog) in WPF?

my wish is to get some kind of "popup" as an input dialog. I really need no big window, just a few TextBoxes.
I tried this with the WPF-Popup till i recognized it's not built for this kind of use.
Here is how it looked like:
http://imgur.com/rWjyMHg
Why i like popup?
doesnt lock screen
no own window
disappears by clicking elsewhere
So how is the best way to achive the same behavior?
My approaches and problems:
Popup: I get no LostFocus event so the TextBoxes won't trigger
updateSourceTrigger (cannot use propertyChanged, because i need converters)
Canvas with Visibility: Z-Index is not possible because the control
is in a DataGrid which overlays the canvas.
Maybe i could try one global canvas in my window and re-use it for the cells, but if i need sometime another kind of popup i cannot re-use this. So the best way would be each cell can open it's own popup (input).
thx in advance

Is there any way to make the Entire Screen Read Only in wpf

On click of a button I need to freeze (Read Only) the entire screen even the menus / tab controls is there any possibility to do that.
Have you tried setting Application.Current.MainWindow.IsEnabled=false? That should propagate down to all other controls which have not overriden IsEnabled.
If you're looking for MVVM way: Disable WPF buttons during longer running process, the MVVM way

disable all input controls in a WPF Window

Is there a way to make an entire WPF Window inert after a button click?
The window is invoked via Window.ShowDialog() and after use, the window is no longer needed for interaction but I leave it open to remind the user of the inputs in TextBox's, ListBox's, and give visual feedback via OxyPlot and so on. I leave it to the user to close the window manually.
One solution is to disable all buttons but that's tedious and it still leaves TextBox's functioning. That's not optimal because for anything to be functioning creates the wrong impression that the Window remains for anything other than looking at. It would be better for every control to be non-functioning by a single setting.
I did it by putting a name on the WPF window code behind and then setting .IsEnabled false upon the appropriate button click. All buttons, combo boxes, text boxes, and even OxyPlot became inert at that point and most parts were greyed out.
Consider creating a dedicated boolean dependency property in your code-behind or viewmodel and binding IsEnabled of every TextBox to the property.

Trap keyboard input in a WindowsFormsHost control in WPF

I have an ActiveX control inside a WinForms user control. My WinForms app loves it!
Now, moving over to WPF, I use the user control in a WindowsFormsHost control. Works great..., but I want to treat this control as a single element so the user can neatly hit TAB over the existing WPF controls AND this user control NOT to 'go inside' it. i.e. just treat it as a single control like all the others.
I think what i need is the ability to trap the keys, and in the event handler simply move focus to the next control in the sequence, but I can't seem to trap any keyboard input. Ive tried the WPF PreviewKey.. events and the like, but once the tabbing gets to the control, it seems to stay inside it and WPF events are ignored.
I couldnt find anything on this in many WPF books and the net. Can anyone suggest a way ?
Thanks,
Jack.
Can't you create some sort of a filter by doing a preview mouse down on the panel or window (whatever is the parent of your controls), this way the panel will catch it before the user control and you should set e.handled to true, and if the user control raised the tab event, keep pushing the focus until you get another control. Preview and e.Handled=ture should solve the problem.

updown control in wpf

I want to use a Similar control like domainUPDown control in my wpf application.
How to do the using infragistic or any other way.
I need a control like a textbox with up and down button.
How to do it?
That is ok, but i need tat up and down button for mouse click
Thanks,
With Infragistics use the XamNumericEditor control. The Up and Down arrow keys make the value change.

Resources