I am writing an WPF application, with drag and drop support within controls in the app, and also drag and drop between my desktop file and my app. I use adorner to change my mouse cursor.
The internal dragdrop operation between controls has no problem. The problem is dragdrop between desktop file and my app.
I set a DragEnter and DragLeave handler for my Window. When I drag a file into my app, DragEnter fired, but it's not just fired once, but keep firing with DragLeave alternatively on my application window.
What I already achieve is, I can manage to drag file into my app, with desired adorner; but if i keep holding the mouse and drag the file back to desktop, the adorner just stuck in the corner. I can't clear the adorner by using DragLeave, because the DragLeave event is firing non stop when I drag mouse in my app.
I want the DragLeave to fired only when the mouse cursor drag leave my application.
Any workaround?
Here is a possible workaround that you could do for this scenario.
DragDrop - DragEnter/DragLeave Events keep firing
Related
I am developing a solution that will be used solely on touch computers. Should I use Click, TouchDown, PreviewTouchDown to listen to the event of clicking the button on the touchscreen using touch? Originally I was using Click but I noticed in some cases that the event didnt fire on first finger tap on the touch screen and had to touch it again to fire. I am using .NET 4.8. Thanks!
If you handle the TouchDown and also set the Stylus.IsPressAndHoldEnabled attached property of the Button to false, the event should be raised as soon as the finger touches the screen:
<Button Content="Touch" TouchDown="Button_TouchDown" Stylus.IsPressAndHoldEnabled="False" />
By default and as stated in the docs, the event doesn't occur until a finger touches the screen and moves.
I am looking to handle the click event on a Telerik Label control in a Silverlight application, but cannot find a click event attribute setting. DoubleClick is catered for (it appears in Intellisense), but not Click. Surely I am missing something obvious here, but I cannot find it.
I tried adding a Click event handler using Caliburn Micro, but that isn't firing either. It's as though the Telerik Label control stubbornly doesn't want to respond to being (single) clicked.
Any advice would be appreciated.
I have a WPF application with some content wrapped in a scrollviewer. I also have a custom dialogbox, which basically is a light customized Window I call ShowDialog() upon.
I can use this just fine on both PC and Tablet.
But now I´ve added the PanningMode attribute to the scrollviewer, so the Tablet users can scroll/swipe with their finger, and now the problem occurs: when I use my dialogbox it shows up, but it seems like it doesent have focus. Because the first time I click on a button in the dialogbox, nothing happens. I have to click twice before the button click is registered.
If I remove the panningmode attribute on the scrollviewer, the problem is gone.
This is only a problem on the Tablet, not on the PC.
Any clues?
I found the problem.
I was triggering the dialogbox in mousedown on an image. Tried several events, but the StylusUp did the trick.
I'm working on a Silverlight 5 application, which is supposed to be deployed on a touch-screen interface. The Button click events are raised correctly on the touch screen as far as I know (I do not have access to a touch screen).
But, what event is raised on touching a SL5 Textbox? The Textbox does not have a click event.
Also, what event in raised on touching a textblock?
You can use MouseLeftButtonDown event.
I'm building a touch screen application in WPF and I'm wanting to show a change in UI when the user presses a button with their finger/stylus. Currently you only get a flicker of UI change once the finger is released but nothing before that.
I've been trying to hook up triggers and/or eventtriggers in the button template to things like stylusdown and touchdown but to no avail.
I've hooked up some console writes on events attached to a button and they appear in the following order:
StylusDown
StylusButtonDown
TouchDown
StylusUp
StylusButtonUp
Click
All of which firing at the same time when the finger is lifted from the screen. (TouchUp doesn't seem to fire at all).
Any ideas on how I could begin to capture a finger pressing onto a button in the template so I can give the user some idea that they are actually pressing a button?
After blogging in more detail about this issue I had a comment recommending using a SurfaceWindow and then SurfaceButtons from the Surface Toolkit (currently in Beta) and now all is working as I would expect.
Update: The link is now dead. Here's the link to that page from Wayback Machine.