Winform desktop app and touch - wpf

I`ve a legacy winform desktop app that works perfectly with mouse and keyboard. It has some selfmade controls that involve the creation of threads and so on, for example the longer a button is pushed the faster a number is incremented.
The application also uses a win32 dll. Now, the client wants that application to be touch enabled and run it in a tablet, which also means resizing and rotation capabilities.
My question is, which is the better way to get that application touch enabled and responsive design?
I can try to modify the existing winform, but I think it will be lot of work with poor results. I can also migrate to WPF and reuse the c# code, but I might have trouble with the keyboard, as I have not found a good way to show the keyboard and maintain the whole app on the screen. Or I can migrate to windows store app, but with the problem of that win32 dll, that I`m not sure it could be migrated.
The winform application is multilingual so creating a keyboard is not a valid option.

If the target is touch screen, then for sure the best option would be a Windows Store App, although there are several limitations.
If you are not going to publish this application in Windows Store, then you should be able to use all WinAPI functions. (I'm not sure what is win32.dll - if it's your own dll then it can be a problem).

Related

Steps for change the UI of desktop app from winforms to wpf

I built a small desktop app on c# .net
Local desktop without any internet connection or communication with other any computers, I used winforms.
As expected I split up between logic and UI, and now I want to use WPF to my UI (change the way I implement the UI part), and in the future I will want to use mobile UI..
What are my steps should be?
Do I need to write new code, or there is something automatic?

Possible to have Silverlight OOB App "Listen" for Keyboard Shortcut?

I'm building a Silverlight Out Of Browswer Application with Elevated Permissions and need the ability to basically have the application listen for a keyboard shortcut such as doing something like Ctrl + F10 will cause a window to take focus of the screen... Personally I am against stealing focus but feel that this is alright seeing as the user invokes it themselves.
So more background... if any of you are familiar with applications like XFire or Steam.. I'd like to the ability to do a keyboard shortcut and have a window open above all the other applications like Steam can with the in-game windows.
If Silverlight can't do this can someone point me towards a better language where I can create this sort of application?
If Silverlight can do this can someone point me in the direction of how to accomplish this?
Silverlight 4 can't do this and Silverlight is not a "Language". Any application developement platform (JAVA, Delphi, VB6, .NET) that has full access to the windows API could do it.
Silverlight 5 includes support for PInvoke so if your willing to wait for the RC to go to RTM then you may be able to hook the system level WinAPIs needed to watch for a hotkey.

User focus in multitouch environment

I am trying to create a multitouch application.
I have the hardware which will allow me to do this. On the software side I want to be able to have WPF textboxes, WPF web browsers, multiple focuses, multiple keyboards and multiple users at the same time.
From what I've seen, I can't be focused on two controls at the same time.
What is the Microsoft MultiTouch approach for this kind of job ?
The OS limitations are what they are (and don't appear to change in Win8): only one hWnd at a time can have focus.
Since you are using WPF though, everything within your application (with the exception of the WebBrowser control ActiveX widgets you may be using) is rendered within one big hWnd.
WPF 4 introduced native support for multitouch, including multi-touch capture. The APIs for this are many but pretty intuitive so I'll just say this... go to http://msdn.microsoft.com/en-us/library/ms590078.aspx and search within the page for all of the members with "Touch" in their name.
The catch however is that the controls shipping with WPF 4 don't work with the touch input events... you'll only be able to interact with one of those controls at a time. To take advantage of the multi-touch capture APIs, you'll have to create controls that are designed with it in mind. Fortunately, the Surface team at Microsoft has you covered on that... the "Surface 2.0 SDK" includes a suite of controls (usable on any Win7 machine, not just for Surface) that were built with this stuff in mind.
To create application with MultiTouch UI, use MultiTouch Framework in .Net
Go to http://multitouchvista.codeplex.com/

Silverlight 4 Trusted Application - Can I drag widgets outside the window?

I have a feeling this really isn't possible, but (for example) would it be possible to implement a trusted Silverlight 4 filesystem browser that allows me to drag files from within the Silverlight application to another application on my desktop?
For Windows... technically, maybe being able to run your own app when a drag is going outside the area of the app. But super complex and challenging.
You would need a few things:
Elevated SL4 OOB app
A COM component on the system, or a native code app embedded in the app that you can execute with parameters about a drag operation, look into isolated storage, etc.
You monitor when a drag starts, and then would need to execute your native code app somehow to realize the drag. Even then, I don't think the new app could pick up on the true drag operation.

Silverlight or WPF for a little winforms/desktop type application?

I have a simple WinForms type application (main form, couple of sub-forms, minimize to system tray with notifications showing here).
I was going to move to WPF however I'm hearing some people say go silverlight (out of browser).
Question - Which way should I go for a simple desktop winforms type app? WPF or Silverlight?
Tks
It depends on what features you need. If you must minimize to the tray, it'll be easier in WPF. Silverlight, however, supports notification toast for notifications. It's not trayed, but it still works well.
Also note that Silverlight doesn't have floating child windows, so if you need them, you'll need to go WPF. You can get close analogs with the ChildWindow control, but they must stay within the bounds of the Silverlight application as they are ui elements, not real hwnd windows.
Silverlight 4 lets you do almost anything you need using COM automation. However, resist using that for major functionality. If you're targeting just Windows, do a click-once WPF application, preferably WPF4 if your timeline permits it. Reserve COM automation for OS "light-up" functionality in otherwise cross-platform applications.
Ease of application deployment is one big factor which Silverlight has going for it.
Depending upon the requirements and audience for the program, WPF or Silverlight will have advantages.
If you are able to run a setup on the target machines then WPF will be an option. If you want to launch from a webpage then Silverlight is the way to go.
if it's an internal app sounds likes WPF + ClickOnce is possibly the better choice. Unless you have (for example) sales people on the road with diff browsers, OS's etc then an installable SL app that talks to a (WCF) service might be a bet

Resources