Creating graphics control in WPF and integrate to other winform application - wpf

We have a existing applicaiton in winform .net. It has a form which displays a kind of flow chart diagram. Now we want to create a control which has enhanced graphics to display this flow chart. With my limited knowledge on wpf, is it possible -
Create a graphics control in wpf which is display the flow chart
Integrate this control to exisiting winform application.
The diagram should have user interation, like moving blocks in the chart.
Is wpf a better solution ?
Thanks.

it is possible to integrate WPF into Winform tutorial here.
With regards to actually creating a flow chart and making it interact with your existing Winform can have its own challenges. Keep in mind that WPF is a very powerful tool so you should consider moving over to WPF if you have the man-power and resources to do so.
Also look into the Model-View-ViewModel design pattern for WPF and you cannot go wrong. Good luck.

Related

Why is the Surface Toolkit demanding an Application?

I'm trying to use Surface Toolkit controls on WPF controls in a WPF Control Library. I'm using these controls in a MFC front using HwndSource. All of that is fine. The problem I have is that now I get the following exception:
A System.Windows.Application is required. Please initialize an Application before using this API.
at Microsoft.Surface.Presentation.SurfaceMetrics..ctor()
at Microsoft.Surface.Presentation.SurfaceMetrics.get_Instance()
at Microsoft.Surface.Presentation.DefaultColorSource..ctor(Int32 rank)
at Microsoft.Surface.Presentation.SurfaceColors..ctor()
at Microsoft.Surface.Presentation.SurfaceColors.EnsureInstance()
at Microsoft.Surface.Presentation.SurfaceColors.get_ControlForegroundBrushKey()
The solution was to new up an instance of System.Windows.Application in my MFC application. That pacified the Surface Toolkit.
See the answer here for my complete WPF in MFC solution. It's pretty marvelous, I have to say. Way better than it was in the old days.

Silverlight 5 - designing an editor (drag and drop)?

I am currently looking to build a workflow editor in Silverlight that will allow user to drag and drop couple of objects from toolbox and draw them on canvas, connect it with connectors - pretty much like a flow chart designer.
I have gone through Silverlight Toolkit and some other links on the web, but not really sure how would I accomplish this.
Is there any built-in functionality in Silverlight, or do I need to use any external libraries for proper drag and drop?
How good is Silverlight in drawing custom shapes?
For reference, check "SilverDiagram": http://www.silverdiagram.net/Projects/SilverDiagram.aspx
Appreciate some quick & real help in this regard.
Thanks!
1.Is there any built-in functionality in Silverlight, or do I need to use any external libraries for proper drag and drop?
There is no built in functionality to develop drag and drop in Silverlight. It is always better to develop your own. It is not that difficult.
2.How good is Silverlight in drawing custom shapes?
Silverlight is your excellent friend in drawing custom shapes. But you need to adapt your thinking you are coming from conventional way of GUI programming like WinForms.

Using WPF controls in a Surface application

I'm needing a TreeView control in our surface application. Situation is ive already created a TreeView implementation using infragistics XamlDataTree. Im wondering whether this control set can be used in a Surface application (being that it is a WPF app under the hood)?
Question also in general can you reuse standard WPF controls in the surface environment?
Also is there a tool already in the Surface SDK suite that would suit a TreeView style layout?
Thanks in advance
Don't know about the XamlDataTree, but in general, you can use any WPF control in a Surface Presentation Layer Application.

Iocomp Winforms Control in WPF

I am planning on using Iocomp plot for very high speed plotting functions in my WPF application. The issue is that Iocomp components are purely winforms based and I have not been able to integrate it at all with WPF. Any pointers on the same would be great.

WPF forms+ Winforms in MDI

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.

Resources