We are using Winforms using the Infragistic framework.
We are considering the move to WPF. The problem is that we have already several forms, dialogs etc in Winforms. We need common look and feel thus we need to migrate all to WPF.
Is there a migration tool to take Winforms and migrate to WPF? I know it is not possible to do it completely but is there something that will do some of the work?
Thanks
In my opnion, and depending on your architecture, a one on one translation is not really the right approach to go here: consider why you want to move to wpf, and evaluate whether you really want to commit to it. It's a powerful framework, but there's quite a steep learning curve and to be really worth it you need to take the time to look at the user experience and see how wpf can help. If you want to have the winforms look and feel, and just move to wpf because it's the next new thing, you're in for an unpleasant suprise.
Anayway, what we've done while migrating our winforms stuff is to make new screens in wpf, and keep hosting the old winforms screen using ElementHost and WindowsFormsHost. These work really well by the way - we haven't had any problems with them so far. We then migrated screen by screen to wpf. Looked like a Frankenstein in the mean time, but at least we had regular feedback and everything was functional.
Related
I am currently learning WPF framework; I have some past (not much though) experience with Winforms. One problem I've had in both is that the menubar does not look native. I've found a workaround in Winforms, but I haven't been able to find anything for WPF. I've not had this problem in other frameworks I've used, particularly Qt.
In many pics I've seen, it looks native enough in Windows 7, but not Windows 10. I included some pics.
How it currently looks:
How it should look:
Thanks in advance!
Edit
While I have not seen the possible duplicate link, I am aware of setting the foreground/background on WPF controls. That link doesn't really answer my question. I don't want to come up with my own style at this point; all I want to do is make controls look native.
If custom styling is the only way, that's fine, but if there is another way, that would be preferable.
Thanks!
I don't think there's a quick fix to get what you want. WPF renders using DirectX, allowing for much more flexibility in styling applications. A WPF app should render exactly the same way on any version of Windows - it will not automatically adopt a native look and feel (that was actually one of the main selling points of the technology in its early days).
While MS made the default styling somewhat close to Windows at the time of release (Vista, I think?), if you want WPF controls to have a particular look you're going to have to style them yourself.
I need to use OpenGL in my WPF project. I'd prefer it to be as simple in installation as possible, but I'm beginning to lose hope.
I've tried SharpGL: it's pretty good and easy to use, but it has massive memory leaks and the app crashes after few seconds. Not very useful.
So now I am wondering: is there an alternative to this library? Actually I don't have to use OpenGL - I just need to present a 3D scene in any technology .. perhaps D3D or something else will be easier to manage in WPF...
What do you recommend?
Kind regards
Q.
Update: Yes, I'm working under Windows 7. And I'd really prefer smt. OpenGL based because I already know the technology.
Within WPF, I can easily say that using XNA will be the easiest way, which many people have done before. There's even an example project here: http://blogs.msdn.com/b/nicgrave/archive/2011/03/25/wpf-hosting-for-xna-game-studio-4-0.aspx
The Tao framework supports this: taoframework-2.1.0-setup.exe
Once you've installed it, right click on your Toolbar and select "Choose Items.." and add "SimpleOpenGlControl" from the .NET Framework Components list. If you can't find it in the list, hit browse and search for Tao.Platform.Windows.dll in your Tao Framework installation directory.
After that you can just drag the OpenGl control wherever you like, and use its Paint event to do your stuff in. (Not really sure how often that event fires though, last time I checked it fired once every 12 seconds or something so you may need to do some magic stuff to have it fire more often - say a thread to call Draw, or some other nifty stuff)
I have used successfuly OpenTK library (http://www.opentk.com/).
Works with WPF/Windows Forms.
Is there a learning curve? I want to pick up Windows Form but when reading many threads about WF vs WPF, I was totally persuaded by WPF. What should I do?
Just learn WPF and forget Windows Forms if you don't need it. Windows Forms and WPF are totally different so learning one of them does not really help with the other.
WPF - I learned windows forms first and it is difficult to switch my mind to MVVM mode now when I build UI's. I personally wish that WPF was my first love.
You do not need to know Windows Forms in order to learn WPF. If you are going to code in C# or VB.NET and are running on modern hardware, I would go with WPF.
There are no technical reasons why you'd want to learn Windows Forms before learning WPF. They are completely different technologies.
Unless you need to use Windows Forms to maintain an old application, stick with WPF.
It depends.
I assume you're working on a Windows application that must be installed on a client machine, Windows Forms and WPF would be good choices.
If you're starting an application from scratch, I would recommend WPF so focus on that.
If you have to maintain an existing application already written in Windows Forms, then you better learn Windows Forms.
Maybe it is not bad to first make a few application with Windows Form, that is classic way, and doing this you will not lose nothing because making application with Windows Form you just make classic application with standard UI. After this if you want that you application has better and nicer UI than go with WPF.
My personal opinion is the the learning curve on WPF is a lot steeper if you want to get all the benefits of using MVVM, so it could also depend on how your development team is set up, with how many people and how complex your solutions are. You can of course just use WPF with all code behind, but you might as well use WinForms if this is all you want to do.
Nope!
WPF is the latest trend. Winforms is not quite dead yet though...
If somebody wants to learn window application development. Starting from WPF will take him to the latest trend. Of course, Winform previous experience can be an advantage.
I was working with a WPF application and I decided that the controls and graphics I wanted to display on the grid might look better if it was a silverlight component.
I thought this way because of all the cool silverlight controls that look very flash-like.
But now that I have gottem my Visual Studio 2010 set up with SIlverlight, it seems that every silverlight app I can make are ASP.NET in nature. It seems that instead of a cool GUI control to make, Silverlight is telling me that it is primarely a dataflow sort of application for the web.
What is the relationship, if any, between WPF and Silverlight. Can I or can I not put a silverlight control into my existing WPF application?
It's my understanding that Silverlight is like "WPF lite", and that in many ways they are almost the same thing but made for different purposes (desktop vs. web). If you want your wpf application to have a different look, you don't need to bring in any other controls from silverlight, because you can simply re-style or re-template them to suit your needs (which you can also do in silverlight). But you can't simply use silverlight controls in wpf because they're compiled to run on different runtimes.
Silverlight does have a number of un-official controls in the silverlight toolkit which are not included in wpf or the wpf toolkit. They are open source, and if you really want, you could port them to wpf, especially since the code is very similar to wpf.
Silverlight is essentially a subset of WPF that is used to create web-based applications.
You might be able to jump through some hoops to get a limited Silverlight application running in WPF, but I doubt it would be worth it...
I know others may point out that SL is WPF lite.
But hope you find out they are different frameworks at least right now though they share XAML, and a similar model.
Not sure if in the future they become the same, but keep the differences in mind is critical at this moment. :)
We know DevExpress is now shipping the same code base of their components for WPF and SL, but that does come after putting a lot of efforts.
http://community.devexpress.com/blogs/ctodx/archive/2010/04/20/merging-our-silverlight-and-wpf-ui-controls.aspx
There are some projects that could use WPF at work, for the sake of adopting new technologies.
But the problem is, I can't jump start WPF easily. I recognize the learning curve is steeper than Winforms. Though even with Winforms one can start doing UIs and programmatically customize them in a day.
So the problem is:
I don't have any resource to quickly learn the fundamentals of WPF at work. I can't read a book from cover to cover before I do the simplest of things.
Most tutorials on the net, just does things that excludes the fundamentals. i.e. they post partial xaml code I can't even put into my xaml code correctly (VS highlights them in red).
I can't justify using WPF over Winforms where there is no significant gain for prety much all projects I can think of. And the learning curve just makes things worse.
So I can't suggest my manager to use this tech over the traditional Winforms, but I want to.
Is there a guide or a tutorial on the net, or a video that explains the fundamentals of WPF so I can explore everything else on my own, except the more complicated tasks?
Fundamental of WPF video from Mix07.
Windows Client .NET get started section has lots of WPF Videos.
Channel 9 WPF content.
Windows Presentation Unleashed is a very good book.
MSDN content for WPF.
MSDN magazine articles on WPF.
Well, the basics are there. You can drag and drop controls onto a XAML surface in VS.NET 2008 just about as easily as you can with Windows Forms. Sure, there's the binding syntax stuff, but getting started isn't too bad.
But you DEFINITELY need to buy a good book on it. You don't need to have read it from cover to cover in order to get started. A decent book will have you up and running in a chapter or two, and you can take it from there. Just make sure that whatever book you buy, it was published after .NET 3.5 (and SP1 preferably) came out.
Also, understand WHY you want to use WPF. Is it just because it's new? Then you're right, that's not a good enough answer. WPF does have some big benefits though:
A powerful binding expression syntax that actually works
No need to repaint your own windows in response to WM_PAINT messages
_ (corrollary to the previous point) It's much easier to owner-draw and make your own controls
MS is spending a LOT of effort to actually develop it
MS is spending minimal effort on developing WinForms
If you need 2d/3d data visualisation WPF will pay by itself quickly and it's very evolving...
Personally I've got in that boat because all 3d hardware acceleration (opengl) wrapper in c# are dying so the solution for a maintened 3d looks like wpf or xna...
I'd suggest you get either expression blend or vs2010 beta ... vs2008 just don't speak wpf enough to help someone who doesn't know exactly what he's trying to do.