Does WPF have GUI layers in the editor? - wpf

I have a single window that does initialization first, and then those controls fade out as the Menu controls fade in. Depending on what the user clicks next, the current menu controls will fade out for the next set of controls to fade in.
While developing in the editor (Visual Studio 2017), I often have to hide and show certain controls so I can see the current 'screen layer' I'm interested in.
While I'm working in the editor, is there a way to click on layers in WPF like clicking on tabs? You can think of tabs like "Layer 1" on the window has the initialization controls, then Layer 2 has the menu controls, etc. Then just show/hide layers while developing in the editor like you would in paint programs. I'm just thinking that would make development easier.

No there is no standard way built-in to Visual Studio.
I strongly suggest to split the layers into (user)controls, this way the designer can focus on one thing at the time.

Related

What should I implement for a small popup control in a VSTO project?

In my VSTO projects (Office 2007 / 2010) I would like to use a small popup control (think Tooltip like features; fade animation and mouse interaction).
I would prefer to use WPF. If I were to do this in WPF I would create a custom Popup Control.
In VSTO, as far as I understand it, I must use a WPF window and then have 2 options, either I put this window in a Windows Form Container or I get the Hwnd of my office app and I add this Hwnd to the Owner property of a WPF Window. Am I correct here?
Creating a whole window, animating it on and off the screen etc to look like a ToolTip seems to be overkill.
So my question is how should I do this. I would prefer WPF.
I don't know if this would work but my first thought is to build a very tiny WPF window which is transparent and start it with the Office App. I can then build a Popup Control (which is a child of this tiny window) which I show and not show at a mouse position. Pretty sure a popup can appear outside the bounds of its parent window.
Just wanted to tidy up my own question with what I did. In the VSTO addin project I added a reference to WindowsBase, PresentationFramework and presentation core.
And then I just follow any tutorial or example that adds a WPF Popup. By popup I mean a System.Windows.Controls.Primitives.Popup. For the Placement I used PlacementMode.Absolute and then used a window point to set its position.
This pretty much answers my question. Of course this popup is literally floating above your office window so you will need to make sure that you control it for example if the office window moves, is minimized and the like.

Image Control disapear after it's dragged in Design

I'm a WPF newbie and, unlike WinForms, I have a hard time to setup things in the design window.
My first obstacle is the Image control. After I drag it in the Design window it disappears and there's no way for me to edit its properties (like with the button control for example). The only way to make changes is via the XAML code which isn't very visual and intuitive.
Is there a way to keep editing the Image control in design mode? (example, move it around, select it to view its property panel, etc.)
All you should need to do is give the image control a fixed height and width and it should stay in the designer.
The best thing about the XAML is which separated from code for better re usability like asp.net. It's best you to learn different layouts such as grid, wrappanel, stackpanel etc. Then, you will feel the power of xaml. Else, you can choose the XAML building tools.
Link to refer

Toolbar Button with Context Menu? Like New Project Button in Visual Studio

I need a toolbar button similiar to the "New Project" button in the standard Visual Studio toolbar. When clicked, it pops up a dialog. However, it also has a small little down-arrow next to the icon graphic that, when clicked, expands a context menu with more options.
Is there a standard control available with this functionality?
I don't think there's built in functionality for a SplitButton in WPF currently. Here's another thread that may help you out though:
WPF SplitButton?
You could combine a couple of controls together to make one fairly quickly. Might as well make a new UserContol out of it that can be re-used throughout your app as well.
Also, a quick search on WPF SplitButton will return a lot of examples on how to make one or you could get one off of CodeProject or CodePlex (though I'm not sure if they'll come with a image property automatically).

What is the best menu metaphor for silverlight line-of-business apps?

So I'm porting an application from WPF to Silverlight and I have realized that there is no standard Menu control.
So I look around and find some third-party controls that emulate the menu control, like this one at codeplex:
alt text http://www.deviantsart.com/upload/1adt6b3.png
But then I decided to take advantage of this situation and think of some new metaphors besides the standard menu we have been using since Windows 3.0, e.g. I like the following enabled/disabled buttons for a small number of choices, which also work well as a vertical stack, and will try to integrate a drop-down button idea to allow it to hold the number of nested choices that a standard menu control could hold:
alt text http://www.deviantsart.com/upload/1bbtg9l.png
What is the best application navigation menu metaphor you have seen or used in a Silverlight line-of-business application?
How about the Office Ribbon?
http://timheuer.com/blog/archive/2009/01/20/ribbon-control-for-silverlight.aspx
http://www.divelements.co.uk/net/controls/sandribbonsl/
http://msdn.microsoft.com/en-us/office/aa973809.aspx
Personally, I like the style of Apple's CoverFlow.
You can load various screens in each of the CoverFlow "panels", show the Active panel in the center, and tightly pack the other panels to the left and right.
You gain the ability to allow the user to see their other panels while working on the active one...and you can add a little flair when the user switches between the panels.

Multiple Forms in C# Window

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.

Resources