Blend + VS 2012 Ultimate Form Missing in VS - c#

I created a WPF form in Blend and now I want to bring this form into VS2012 so I can start putting code to the buttons, etc. I cannot open projects from VS2012 directly into blend the shortcut to do this isn't there, but I can edit my Blend project in VS2012. When I do this and run the project in VS2012 I see the form as expected which I've created in blend. The problem is in VS I cannot find the actual form anywhere to work with, I can only edit the files themselves. Not sure if I'm doing something silly, but I'm trying to click into buttons to create events like I would normally. Any ideas what I'm missing?
When I open other WPF projects that I started in VS2012 (not blend) the form comes right up for me to interact with.

In VS open the xaml for the form. If you can't see the designer, look at the bottom of the xaml window, there should be some tabs there: XAML, Design and Document Outline. Selected Design will switch your view from the Xaml to the 'Form view' (the designer). If you look on the right there are some buttons for changing the view to a split view, either vertically or horizontally that allow you to see both the Xaml and the design at the same time. You can end up in the state where you don't see the form if you expanded the xaml view to fill the pane.
The horizontal view will look like this:

Related

How can I have a solution based layout for my WinForms application?

I am coding a C# forms application where I am wanting to have the layout of my application to have a similar style of the Visual Studio 2013 layout. By this, I mean to have a property grid at the lower right of the screen, a solution explorer to the top right of the screen, tabs for the content and a toolbox.
Do I need to use a FlowLayout control for this? I have previously found some sample code with this layout all coded to use as a template, however I cannot seem to find this after doing a search. What is the correct terminology for this layout style? Also, is there a Microsoft sample for this?
Here is an image of what I am looking for:
Thanks.
You can use the following readily made controls from Visual Studio:
System.Windows.Forms.PropertyGrid for the properties
System.Windows.Forms.TreeView for the solution explorer
For the toolbox you will need to create a custom-control, with search box and dropdown tabbing of pages. See making of custom controls here:
https://msdn.microsoft.com/en-us/library/vstudio/6hws6h2t(v=vs.100).aspx
http://www.codeproject.com/Articles/2016/Writing-your-Custom-Control-step-by-step

WPF designer view dont show

I have been using Visual Studio 2013 (Downloaded ISO-version) express C# winforms for some months now and i wanted to start using wpf (because of the design possibilities ), however when i start a new WPF C# project I only get MainWindow.xaml and MainWindow.xaml.cs. i have read on many different pages about this and I've tried repairing VS and pressing CTRL + F7 while in the WPF project and many other things, but none of them works.
I can start the program without difficulty and a window which seems to be the standard window appears. and in my solution Explorer there is nothing related to the word design so i don't think its there either.
I would be grateful for any answer. :)
If you are only seeing the XAML, your design view may be collapsed. There is a small button on the bottom right of the XAML pane that allows you to collapse/uncollapse the design view. I have included pictures, the first of which highlights the button, and the second shows the result.
I would encourage you though to use the design view only as a preview window, if at all. The idea of dragging and dropping and positioning controls via the design view is very winforms style of thinking, and in WPF you want your positioning to be more relative to your layout containers. Personally, I do not use the design view at all when I am doing wpf, as I find it becomes easy to read your markup and see it in your head.

Panes disappear after dragging

I am trying to use Telerik's RadDocking control in an WPF application using Caliburn.Micro and MEFBootstrapper. Unfortunately, the panes disappear when I drag and drop them to the "right" place.
Repro steps:
Drag one of the panes.
Drop the pane on any of the arrows around the center wheel (see the screenshot at http://1drv.ms/1utkqSZ).
The application window is moved to background and the panes disappear.
If I drop the pane on any other place (left, right etc.), onto the wheel but not on the arrows around it or make it float, everything works as expected.
After the issue happens, the WPF Inspector shows just the OpenedScreens ContentControl in MainWindowView and the direct sibling ContentPresenter as the final node of the visual tree. However, all views still seem to be attached to all models (OpenScreensModel, FirstScreenModel and SecondScreenModels) and the OpenedScreensModel.Items collection still contains both the first and the second screen.
You can download the testing projects and see the screenshot at http://1drv.ms/1utkqSZ. The second project is the same as the first one but contains some debugging code.
Sample project structure:
MEFBootstrapper: Settings to register Telerik conventions and make the Import[]/Export[] attributes do their magic.
TelerikCaliburnMicroConvetions: Conventions to make the Telerik controls works in Caliburn.Micro by default. Part of it is from a public project on GitHub, the RadDocking convention is new made with collaboration with Telerik's support staff.
CustomPanesFactory: Complimentary class for creating panes when created by Caliburn.Micro's convetion. It puts everything in the mainGroup pane group.
FirstScreen, SecondScreen: Just same sample panes to show.
MainWindowView: Just a holder of the OpenedScreens and opens FirstScreen and SecondScreen during initialization.
OpenedScreens: Manages the screens. All opened screens models should appear as a pane on the main window.
How to fix it?

Pre-defined XAML code for new control that is added in VS designer

Is there a way to automatically generate XAML code when you drop your control from toolbox to designer? I.e. it would create certain objects (nested properties) automatically and user would not have to type the same code every time to set certain (nested) properties. Kind of a template XAML code that is pre-defined by control's developer.
I'm pretty new to WPF so I'm wondering why there aren't any nested properties in the controls that are in Visual Studio's toolbox (button, label etc...)? Are attached properties a cure for this or have they just cut corners when designing WPF. :)
The problem is that my control (WinForms style property hierarchy) has nested properties and if I "internally" in my code create objects for those properties then XAML does not reflect the situation because it does not have any elements that match the current situation (i.e. the objects created in my control's constructor).
Is the only solution to leave all the properties null and let the user create them all? That way it seems to work correctly but user has to write many lines of XAML to reflect the situation in WinForms.
The functionality that you seek is not available via any of the controls in WPF. However, Visual Studio used to have Macros that would enable us to add pre-written sections of code into our pages, but unfortunately, they decided to remove that great functionality. Fortunately, they have introduced Code Snippets as a partial alternative.
Unfortunately again, these Code Snippets don't work in XAML pages, but once again fortunately, there are a few Visual Studio add ins that will enable you to enter pre-written XAML into your pages at the click of a button on the Code Plex website:
XAML Code Snippets addin for Visual Studio 2010
XAML Snippets for Visual Studio
Please try using one of the above add ins to see if they meet your needs.

In visual studio 2010, when I open a form in design view - some numbers showing up next to each control

I keep seeing these odd looking numbers on just one of the forms in my application. Any idea why this appears - this doesn't cause any trouble in running the application, but I need to make some changes in the design and the regular selection borders are not visible.
These may be the tab orders, but couldn't find out how to remove/ hide these.
All help would be appreciated.
Upen
Got the answer guys- in the main vs2010 main menu- go to View--> taborder - click to toggle off or on.

Categories

Resources