Multi-Touch in Silverlight - doesn't recognizes the touch point - silverlight

I'm having this Silverlight project which I'm working on. I'm currently trying to add Multi-Touch functionality to it, and I'm having difficulties.
It seems like the system doesn't recognizes the touch point immediately when I'm touching down on a point, but only when I'm releasing it.
This affects the map control I have - its not supporting pan, and the zoom doesn't work properly.
I suspect that this might be because of a Context Menu on Right Click that I use (to be specific, it's Telerik's RadContextMenu).
Can anybody tell me what is wrong or what is interfering the Multi-Touch behavior?

Maybe you're setting the windowless param to:
<param name="windowless" value="true" />
Apparently multi-touch functionality doesn't work when using this setting, along with other things:
http://msdn.microsoft.com/en-us/library/cc838156%28v=vs.95%29.aspx
Sadly, it looks like all of the official documentations doesn't mention the multi-touch functionality limitations.

Related

Difference between the MouseOver and PointerOver in VisualStateManager

I was wandering if someone could explain the difference between MouseOver and PointerOver? I am creating a custom ComboBoxItem Style, and using this link as a startpoint. After creating a playing around I discovered that the VisualState PointerOver that they use doesn't work. I remebered using MouseOver in a different Style so I replaced PointerOver with MouseOver.
So I was wandering if there a sepcific reason why MSDN would use PointerOver instead of MouseOver, if there is a reason other than being able to call it one self.
As far as I know, the state PointerOver and the IsPointerOver property appeared in .NET 4.5, and is actively used in Windows 8.
The main difference is that MouseOver works with mouse cursor, and PointerOver works as the mouse cursor and the user's fingers or other means. This is due to the fact that Windows 8 more mobile platform than the old versions, hence it is more focused on working with TouchPad. Therefore, Microsoft is more focused on the support of their latest operating system versions.
The conclusion is: if your application is more focused on Windows 8 and mobile applications, then you need to use PointOver. If your application will be used on versions below, then use MouseOver.

Why WPF renders differently on different versions of Windows?

I read that WPF uses DirectX under the hood to perform its rendering, that it doesn't rely on the dinosaurian libraries that WinForms uses to render controls.
So I made my Presentation layer with WPF and it looks the way it should under Win8.
Then I deployed the project to Windows Server 2003... to find out that my nice little custom message box looks awfully WinForms-like and somewhat clunky; the button controls are VERY similar to the WinForms ones, the expander control is no longer shown as a circled ^ arrow and looks like it was drawn in 1998 (picture the ^ arrow on an ugly square flat button that pops up when your mouse hovers over it).
From the Pro WPF in C# 2010 Bible:
Part of the promise of WPF is that you don't need to worry about the details and idiosyncrasies of specific hardware. WPF is intelligent enough to use hardware optimizations where possible, but it has a software fallback for everything. So if you run a WPF application on a computer with a legacy video card, the interface will still appear the way you designed it.
So, is this a lie? To me it is, because it doesn't appear the way I designed it.
If not, then why/how doesn't the thing render identically regardless of the machine that's running it? Is the software fallback somehow designed to mimick Win32/GDI rendering? Is there a way to get my little custom message box to look identical on Win8 and WinServer2K3?
That has NOTHING to do with DirectX / Rendering / video card / any of that.
and EVERYTHING to do with WPF taking the DEFAULT appearance of ALL UI Elements from the Windows Theme.
If you don't want this behavior, you'll have to provide Styles and Templates for ALL UI element types, or otherwise find a way to include PresentationFramework.Aero.dll in your application and use that as the default theme library.
Take a look at this answer

Either Free or Paid alternative to Silverlight Web Browser Control to target visibility(z-index) problems?

I am using Silverlight WebBrowser Control in one of my application, and all the Silverlight Content hides behind the WebBrowser Control.
I know, we can't do anything about it and have read about the Air Space Issue also. I have also gone through the following links:-
How to place a WebBrowser control below other controls?
But its really required to solve it for my application, so I am looking for some alternatives, either FREE or can be PAID too.
I have read about the FireFox Gecko browser, but it seems it is a pure Windows Forms Control and I wonder whether I can use it in Silverlight or not, and also whether it will solve the z-index issues if we can at all use it in silverlight.
Does any body has any solution for this ? Either Free or Paid.
Thanks
Awesomium is a fairly decent browser since it uses chrome as it's base and it's a native control for WPF so it'll respect your z-index. However, it's a wpf control right now and it's not clear if SL is easily supported or not, but this may help.
Awesomium website: http://awesomium.com/
some mention on how to get a silverlight dll to use:
http://support.awesomium.com/discussions/questions/119-using-awesomium-with-silverlight-40

Windowless Silverlight (and Flash?) app on Firefox: wrong mouse positions reported

When I create a windowless Silverlight app and run it on Firefox, wrong mouse positions are reported. There is a vertical offset between the actual mouse position and what the application responds to.
I also tagged this question with Flash because my research shows that this problem also occurs with Flash (see links below).
To reproduce:
Step 1: Create a new Silverlight application.
Step 2: Inside the grid of MainApp.xaml add the following:
<HyperlinkButton NavigateUri="http://google.com" VerticalAlignment="Center" HorizontalAlignment="Center">GOOGLE</HyperlinkButton>
Step 3: In SilverApplicationXTestPage.aspx (in the web project) add the following parameter to the Silverlight object:
<param name="windowless" value="true" />
Now run the silverlight application. When you hover the link it doesn't get underlined. Now slowly move the mouse up until at a certain offset above the link it will get highlighted.
This problem doesn't happen if you do one of the following:
Switch Firefox into full screen mode (it seems that the top bar is the cause for the offset, so when it's not visible there is no offset).
Do not use Silverlight in a windowless mode.
Use any other browser.
I'm using Silverlight 4 on Firefox 8.0 on Windows 7.
This seems like an old problem that affects not just Silverlight, but also Flash.
In my research I came across the following suggested workarounds, non of which worked for me:
Do not use overflow in css.
Use css to set html margin of 1px.
Do not use iframe (but the reproduction steps above do not use an iframe anyway).
As I mentioned none of the above workarounds seem to work.
Here are some references to mentions of this problem or similar:
http://forums.silverlight.net/t/161640.aspx/1/10
https://bugzilla.mozilla.org/show_bug.cgi?id=362193
http://forums.silverlight.net/t/94583.aspx/2/10#
https://bugzilla.mozilla.org/show_bug.cgi?id=536429
Does anyone know how to overcome this? Any workaround? I'm desperate!
I found this: http://support.mozilla.org/en-US/questions/795168.
"Enabling the plugin-container.exe in about:config (dom.ipc.plugins.enabled) fixes the mouse issue but then Silverlight plugin pop-ups (webcam/microphone permission for example) freeze the browser."
I didn't see the problem with the popup (a copy permissions) after changing the config.
Making it full-screen also helped before I made this config change.
This requires the user to change their browser setting, which is not ideal.
This is similar to this question: Silverlight- bad mouse position when embedded in html page when Firefox has zoom

Track "commands" send to WPF window by touchpad (Bamboo)

I just bought a touchpad wich allows drawing and using multitouch. The api is not supported fully by windows 7, so I have to rely on the build in config dialog.
The basic features are working, so if I draw something in my WPF tool, and use both fingers to do a right click, I can e.g. change the color. What I want to do now is assign other functions to special features in WPF.
Does anybody know how to find out in what way the pad communicates with the app? It works e.g. in Firefox to scroll, like it should (shown on this photo). But I do not know how to hookup the scroll event, I tried a Scrollviewer (which ignores my scroll attempts) and I also hooked up an event with the keypressed, but it does not fire (I assume the pad does not "press a key" but somehow sends the "scroll" command direclty. How can I catch that command in WPF?
Thanks a lot,
Chris
[EDIT] I got the scroll to work, but only up and down, not left and right. It was just a stupid "listbox in scrollviewer" mistake. But still not sure about commands like ZOOM in (which is working even in paint).. Which API contains such things?
[EDIT2] Funny, the zoom works in Firefox, the horizontal scrolling does not. But, in paint, the horizontal scrolling works...
[EDIT 3] Just asked in the wacom forum, lets see about vendor support reaction time...
http://forum.wacom.eu/viewtopic.php?f=4&t=1939
Here is a picture of the config surface to get the idea what I am talking about: (Bamboo settings, I try to catch these commands in WPF)
alt text http://img340.imageshack.us/img340/3751/20091008210914.jpg
Have you had a look at this yet.
WPF 3.5 does not natively support multi-touch (it is coming in WPF 4.0) however the samples in that kit should get you started using the Windows7 Integration Library which access the native Win32 APIs to provide the required support (Don't worry its not real ugly:).

Resources