WPF forms+ Winforms in MDI - wpf

We have an application which is using winforms. Now we want to upgrade it.
We are planning to use some WPF forms and some old winforms. and we also need to use MDI.
From MDIParent we need to open both winforms and WPF forms. And these forms need to be in tile format. I got to know that WPF doesn't support MDI.
Is there any other way to achieve this?
Using AvalonDock, can we display the forms in tiles format also. I know that it display in Dockable format.

why you want to upgrade your application to wpf and still use some of your old winforms and the mdi concept any further?(i dont like mixup both:))
for quick and dirty what about using your winform app and integrate wpf in it - if you want/have to?
EDIT:
if you want your WinForms in Wpf you can use
<WindowsFormsHost />
It should work with Avalon too. Here is an example for WindowsFormsHost.

Related

I want to use Windows7 visual style in my C# projects

I want to make lists in a WinForms project like this one:
Is there an easy way to do it? or I have to code it by my self??
Would depend on whether or not you re using WinForms or WPF. In WPF, you could use list box templates:
http://msdn.microsoft.com/en-us/library/cc189093(v=vs.95).aspx. I think it would be harder in WinForms and I'm not aware of any controls that match the appearance you are looking for although you might check out the Telerik and DevExpress WinForm controls.

Can I use silverlight application in wpf application?

I got a silverlight sample from http://gallery.expression.microsoft.com/ like the analog clock and the progress bar. I am making a wpf desktop application using microsoft blend 4. My problem is how to put/run/embed the sample in my wpf application using the blend 4.
I choose wpf application because I can add windows/form and the codes are almost the same with the windows application form.
and if silverlight is not possible to run in wpf application, can you suggest how to do layered controls? My plan is to run first the loading bar. and then hide it to show the main menu and the analog clock.
Silverlight is very-very-very compact version of WPF functionality.
You can just rewrite sample to WPF and it will run more efficient.
Silverlight is just like adobe flex which helps in making(running) web browser apps..
If you use silverlight in your wpf application , then you have to use webbrowser control..
For knowledge:
When we want to try to bring wpf for webbrowser apps we use silverlight..
& doing vice versa(like you are doing), don't make much sense..

Can we integrate a WinForms application with a WPF application?

I want to integrate two existing applications into one. One of those apps is built on Windows Forms and the other on WPF.
Is it possible to achieve this?
WPF supplies the WindowsFormsHost class that allows you to host WinForms controls inside a WPF window; conversely, WinForms supplies ElementHost that allows you to host WPF controls inside a form.
Unfortunately how well things work out is highly dependent on exactly what you are doing, last time I checked there were more than a few rough edges. For more information, definitely start from this MSDN page.
If you want to have "independent" WPF windows and WinForms forms inside the same application, you will have to make both frameworks "share" some code in your UI thread's message loop. For a primer on how to do that, see here.
There are various classes to help you with this.
For hosting Windows Forms controls in a WPF Window, you can use the WindowsFormsHost class. For hosting WPF Controls in a Windows Forms Window, you can use the ElementHost class.
You can look here for mor information on the subject (windows forms section):
http://msdn.microsoft.com/en-us/library/ms753178.aspx

Winforms toolbox tools for WPF

I'm new to WPF and I'm wondering is there anyway to have elements from Winforms toolbox in WPF. I mean the Winforms toolbox has a lot of elements and they're not present in WPF toolbox. for example something like PerformanceCounter in Winforms toolbox is not found in WPF toolbox.
thanks in advance
There are some controls that didn't get represented in WPF, but you can use WindowsFormsHost. As the name indicates, it's purpose is to host the Windows Forms elements.
Walkthrough: Hosting a Windows Forms Control in WPF
I would add that things like PerformanceCounter you can use in code, rather than placing it on a form. Other elements which do have a UI purpose can be placed inside a WindowsFormsHost control. I do this with ReportViewer -- it's a Windows Forms control that has no WPF equivalent.

Can the controls in the toolbox be used in both Winform and WPF application?

If not, how can I know which controls are used in winforms, which controls are used in WPF?
If you develop a WinForms application, WPF controls are not shown in your toolbox, and vice versa.
If you want to use a WinForms control in a WPF application anyway, there's the WindowsFormsHost WPF control for that.
For hosting a WPF control in a Windows Forms app, you can use the System.Windows.Forms.Integration.ElementHost control.
The toolboxes already filter what controls you can use depending on whether you have created a Win Form or a WPF application project.

Resources