I currently have some non-visual components that were written in Winforms. I added them to the toolbox, and can drag/drop them from the toolbox onto the form and it creates objects of that component to use. I was wondering if there was a way to drag/drop these Winforms created components onto a WPF app the same way? As of right now, the component is grayed out in the toolbox, and I have to manually add a reference to the .dll of the component. I then have to initialize the object in the code-behind manually.
Again, this is for a non-visual component. The reason I'm asking is because this is for a person that originally worked with Delphi and wants to be able to drag/drop components like that.
Related
I'm new to WPF and never happened the need for me to create a wizard in WPF. I want to know what control to use to make a simple wizard in WPF that I can collect information on each page and finalize an operation in the last page(step). I actually want to make it using native WPF controls. I don't know, like using page navigations or so. Any native wpf ideas?
You can make use of Tab Control for making a wizard.
For moving to the next screen on a particular index can bind the SelectedIndex property of the tab control to a property in the view model and if you do not wish to display the tab items in UI can set its height to 0.
Check out the WPF Extended toolkit. It has a built in Wizard control.
Wizard
Am looking to implement a detach and popup UI behaviour in my applcation.
It basically means that I will be displaying say, a stackpanel with lot elements on the right side of my page. And on a button click, I want the stackpanel part to popup(removing its allocated space in the UI) and should be able to move it above the underlying wpf UI.
What am trying to do is that remove the stackpanel from its parent grid on button click and add it as the child of wpf popup control. But I am facing some issues doing this way. However I just want to know whether I am doing it in the correct way or do anyone have a good alternative for implementing this pin out functionality am specified here?
Thanks,
Vinsdeon
How about using this kinda nice control, AvalonDock, which is simulating Visual Studio's dockable components behaviors?
http://avalondock.codeplex.com/
It will spare you the pain of developing such a specific functionality, and will have a great reusability anyway
I want to design an application much like Visual studio where the toolbars are context sensitive to the workspace area and their are common toolbars which have context sensitive functionality like cut, copy, paste (for these I can have application commands), comment selected (custom commands).
I want to keep the workspace unaware of toolbar controls.
I tried using custom routed commands but it only works on parents in the visual tree (bubble routing strategy) however my toolbar and workspace are on the same level in the shell.
Are their specific patterns (I am sure there must be) for designing such an application in WPF?
I implemented a simple version of what you described, where a toolbar had options that were context sensitive and were simply shown or hidden. The application used the MVVM pattern, so my toolbar had a view model. I leverage the message bus (sometimes called event aggregator) to publish messages which the toolbar's view model could react to.
I am working on a little WinForm app and have been trying to find the answers to a few questions i have without any luck. Im a ASP.NET developer so WinForms development is new to me.
Here is my main question:
How do I create a menu system that once selected the contents will render in the Main form of the selected item. If its a GridView I want to the GridView to render inside the main application so they can navigate away without having to deal with the modal popup. I do not want to popup forms unless i explicitly say so. I guess the equivalent to this would be using a Master page in ASP.NET.
Make sense?
The closest thing to Master pages in winforms would be MDI (multiple document interface), which is a hideous Windows 3.1-era abortion of a user interface. Why this option is even still around, and why anyone still uses it, is beyond me.
The second closest thing (and something more acceptable as a UI) is just to have one main form in your application, and implement the different pieces of functionality your app requires as separate user controls which are displayed on the form and hidden as the context requires.
A weirder method, but one that might also work for you, is to use forms inheritance - design one "master" form with the menus and controls that you want to always be present, and then have each form in your app inherit from that master form. This would not appear to the user to be much different from my second option above, so I wouldn't bother with it.
There really isn't anything similar to Master pages in WinForms.
The closest to what you want to use would be a TabControl selecting a different tab will display that tab over the other tabs. If you don't like the tab look you could extend the TabControl to not show the tabs or hack it together by placing the TabControl inside a panel just large enough to show the content but not the Tabs and change tabs programatically in your menu control.
I'm trying to build a simple application to test the idea of having multiple forms in one application. For example, in Visual Studio, you have the IDE - design area, and on the right hand side, you have a form called Properties and Solution Explorer
When you click on something in the design area, i.e. Textbox, on the right hand side, the properties for that object selected automatically changes.
I do not want to add the PropertyGrid ontop of the same form where the objects are, it must be independant on its own.
My ultimate goal is to have a 3D viewer/WPF and on the right hand side, a form. When you click in the 3D viewer on a line, or point, the selected object's properties must be displayed in the PropertyGrid
Second to that, I want to be able to dock the forms, or reset to default layout.
Screesnhot:
(properties should be docked inside the main form - not like screenshot)
Example: http://dan.virgesystems.com/images/CPVimage.JPG (Dead Link)
If you decide to do it using WinForms, there's a good C# opensource library for VS-style docking: http://sourceforge.net/projects/dockpanelsuite/
Here's a screenshot of an application using it: http://wiki.openstreetmap.org/wiki/Image:Kosmos.2.0.png
Try encapsulating your viewer and form into user controls. You can use the splitter control or panels to layout the container form as you please. Communication between the user controls can be done through events or direct references.