Panes disappear after dragging - c#

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?

Related

(UWP) When SplitView pane is open, interaction with the rest of UI is not allowed

The PERFECT example of what I need is in the Groove Music app. When the SplitView pane is open (in overlay mode), you are still allowed to interact with the rest of the UI (clicking other buttons, etc., and even when you hover your mouse over controls that are outside of the pane, they are highlighted as normal).
In my app, NOTHING is clickable outside of the pane area (besides the 3 system buttons in the top right area of window). But once you click outside the area of the pane, it closes. ONLY at that point can you interact with the UI as usual again.
I searched through the SplitView's property list to see if I was missing something, but still haven't figured out what I'm doing wrong here. Any help would be greatly appreciated. :]
The behaviour you're describing is by design. If the DisplayMode property of a SplitView is set either to SplitViewDisplayMode.Overlay or SplitViewDisplayMode.CompactOverlay and when the SplitView is opened, rest of the UI is inaccessible. To have it opened all the time and let user interact with the rest of the UI, you have to use either SplitViewDisplayMode.Inline or SplitViewDisplayMode.CompactInline.
For more info, see the Split​View​Display​Mode enumeration.

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.

Blend + VS 2012 Ultimate Form Missing in VS

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:

Navigating between parental panels

I have problems with editing panels in C# windows forms(Visual studio 2008). I placed some panels into another, and now I have problems with navigating panels inside parental containers. Is there any tool that gives not only drag-drop control, but also tree view of container and panels in it. For example, like Navigator window in NetBeans(IDE for Java). Any help?
I'm not sure about VS2008, but newer versions have Document Outline Window (View > Other Windows > Document Outline)
To not get lost in controls, consider to name them properly. Then you can find them in the list of Properties window.
Instead of label1 use labelInputName, located on panel1, which you also rename to panelInput. This gives parent/child feeling and you will never lost.
If you get lost, use Document Outline window to see tree-like relation via Controls property (who is control of who). This window is a helper (help to find and select control), you will still have to use designer to do changes.
Another important thing is UI design. Whenever you get cluttered or bulky feeling, than it's the time to change something.
Making UserControl for repeatable part is one way.
Another is to differ design and run time (what you see in designer): to example, if you have several panels, which has to be shown at same place, then you can use dynamic container for them (FlowLayoutPanel, TableLayoutPanel) or you can have them placed in a way for you to easily see them in design-time, but their position will be corrected during run-time (to example, in the constructor). Prioritizing designing is a must if you are going to support project and edit functionality in next versions.
p.s.: talking about winforms, but all said should be true for wpf as well.

C#: Move Controls From Form to tabPage in VS Form Designer

I decided to change a utility I'm working on to use a tabpage. When I tried to drag various controls from the form to a tab page on top of the form, it made copies of the control, giving it a different name. It's easy enough to just remake the form on top of the tab or just edit the source code in the designer to have everything be added to the tab instead (and this is what I did, which worked), but it seems like there would probably be a better way to do this via the gui.
The correct tool for this is the Document Outline (CTRL+W, U). Simply drag your set of controls in the outline so that they are under the tab page. Voila.
The document outline dramatically simplifies these types of operations, especially when you are dealing with complex layouts.
Have you tried cut and paste. That usually works for me.
Your control key is stuck. Do not press control key when dragging controls.
I drag controls from form control to tab page controls all the time no problem. Answer #1 is totally correct.
You can use the Document Outline window and move the controls to the tab page one by one by dragging tree nodes.
The hardest problem is retaining control locations on the tab page.

Categories

Resources