Expression blend 4, go back to window after editing DataTemplate? - wpf

If I have a Xaml Window open, I can goto Resources in the right panel, and see all my DataTemplates. If I right click on one of them, I can select a data template, click edit, then graphically edit my template.
Now that is nice, but, how do I go back to the Window containing the DataTemplate? If I right-click the window in the right hand panel, I can select "view xaml", but there is no option or menu I can find that returns me to the main Window for graphical editing. Where is it?!?
Anyone know how to return?

It's somewhere in the bar above the design view if i remember correctly, it's a path in the hierarchy which you can go up.
Also in the Objects and Timeline toolbar there's an up arrow which brings you back.
(Where it says DataTemplate1 (ContentPresenter Template))

Related

How to show a preview of item template on Windows Phone Designer?

I'm designing an item template for a ListView but it is not shown on the designer.
I think that is because the ItemsSource is not set at the design-time, I set the ItemsSource at run-time only.
So is there a way to tell the designer emulate data for ItemsSource or whatever to show the preview?
Currently, I have to run the app to see the result or copy content of ItemTemplate to outside of ListView to see the preview then copy back later.
Guess I should have just put it as an answer.
In VS, right-click your ListView in the Document Outline and choose "Edit Template -> Edit Generated Items" or the same in Blend.
Then to toggle back out of there to your parent view hit the little icon in the top left corner of the document outline that looks like an upward pointing arrow on a bar

WPF Tab item sliding on mouse hover

I want the tab item to be displayed by sliding effect as given in VS 2010, eg. when we point docked objects like toolbox, solution explorer, properties it is shown immediately. In that way i want my tabcontrol to display items by sliding effect. is it possible? Please Help...
you can achieve similar things by making use of AvalonDock, its opensource.

Where is the Tab Order Assignment dialog in Visual Studio 2012?

For as long as I can recall, Visual Studio has had an integrate dialog that allows you to easily organize the tab order of your controls.
I've just created my first VS 2012 WinForms project, added all of my controls and went to find the Tab Indexing dialog, and it appears to be missing from Visual Studio.
I found this MSDN article which states that I can open this dialog by going to FORMAT>Tab order. The problem is that there is no Tab Order option on my FORMAT menu. Alternatively, the documentation states th at Ctrl+D should open this dialog. It doesn't.
Another alternative is to select the VIEW>Tab Order menu option. This method causes Tab Index boxes to hover over your controls. You can subsequently click on your controls, one at a time, in the order in which you want them to tab, to set the tab order.
This isn't acceptable because my form contains numerous panels and group boxes that cover one another. It is impossible for me to click-through my controls because many of them are no longer visible in the designer.
Is there an easy way for me to setup the tab order of my controls like there previously use to be within older versions of Visual Studio?
It is still available, you just need to add it back to the View menu. Tools + Customize, Commands tab, Menu bar = View. Select the menu item in Controls where you want to insert it, say the bottom one. Then Add Command, Category = View, Commands = Tab Order.
Your memory of this command does sound a bit hazy, it was never on the Format menu and its never been a dialog. If you want to put it on the Format menu then you can, just pick the Format menu bar in the Commands tab. You can't make it a dialog though, it numbers the controls in the designer view. Some odds that you actually remembered the View + Document Outline command.
Go to your alignment toolbar. At the end, click the tiny little "Add or Remove Buttons" down arrow. Click the "Add or Remove Buttons" button, and look towards the bottom of the list. You should see Tab Order. Click on that and it will be added to the alignment toolbar.
I found this to be very useful http://msdn.microsoft.com/en-us/library/csz6b8x8.aspx
It allows you to simply click on the various controls in the order that you want them to tab through. You do this while you are in the "Show tab order" mode as described above; the tip from Elton about adding the icon to a toolbar makes it easy to toggle the mode.
Ctrl-doubleclick the first control, then click subsequent controls, and press Enter to terminate. You can also start on the Nth control if you Ctrl-click the one before it, then click in order as normal.
(VS Express 2013)
The Tab order tool from the view menu disappears in some cases. For example, if you clikc a text box, then go to its properties, the tab order option will not show. You must select a control, then immediately go to the view menu and choose tab order.
You can click through your controls with the Document Outline view. If they all have the same TabIndex value, their Z-order will be used as tab order. The Z-order can be changed also with the Document Outline view.

WinForms : how to add toolStrip to a form already divided into left/right panes using a SplitContainer control

My form is divided up into left and right panes, and the right pane is split into upper and lower panes:
AAAABBBB
AAAACCCC
There's a menu-strip at the top, below the title-bar and a status bar at the bottom:
menuStrip
AAAABBBB
AAAACCCC
status
Now I would like to add a toolStrip below the menuStrip. But when I do so, the toolStrip obscures the topmost content of the panes created using the splitContainer control. The Dock for the toolStrip = Top.
What am I doing wrong that the toolStrip doesn't simply get inserted between the menuStrip and the splitContainer control, pushing the splitContainer control down, so to speak?
You have to play with the BringToFront and SendToBack context menu items of those controls in the designer.
Drop the toolstrip container onto the form, then open the Document Outline window to re-arrange the controls into the correct hierarchy.
There are 2 simple ways of doing that:
Method 1
Open Document Outline window: View\Other windows\Document outline. Use buttons to place your control in the correct place
Method 2
Notice, that the current control in designer form is marked with some kind of focus rectangle.
You can easily navigate through current control parents using Esc key: once pressed, it can be used to go exactly one parent up in hierarchy.
Knowing the above just place your control in any place, cut it and then past it in the correct container. Repeat the step for any other control which is not in a good position
When you need to change the order of control in the same container use Bring To Front and Bring To Back from context menu
You have to set the splitcontainer's dock to none and instead use its anchor settings

Clip a wpf Popup at bounds of a main window

From what I understand, the popup exists within it's own visual tree. However, I've noticed a few properties, Clip and ClipToBounds. What I am wanting to do is Visually clip a popup at the right and bottom edges of a window regardless of the fact that the popup is independent of the bounds of the window. I'm not using XAML, but if somebody knows how to do it in XAML, then that's fine. I can get to the main window using System.Windows.Application.Current.MainWindow. Is it possible from this to get a value that I can use to clip the popup? I'm assuming that if there is a value that I can use, then I would be able to bind the clipping of the popup to that value. This is really not necessary since after the popup initially opens, if the window gets moved or resized, the popup closes. So I would really only need to clip the popup when it opens. The reason I would like to do this is because although I am using a popup, I don't want it to appear as a popup that exists outside of the window. FYI this is for a popup calendar for a custom datebox. Any ideas, as well as clarification of misconceptions that I may have, would be greatly appreciated.
Furthermore, the popup can be launched from a user control that is not directly on the Main Window. So in that case it would be easier to use a popup. As apposed to a UC inside the XAML
I know this is a year old post, but in case any others come here looking for answers... If you don't need the popup to be outside of your window, why use a popup at all? It'd be far easier to simply use a control in a canvas (for instance) and control it via its Visibility property. Then you'd automagically get your clipping.

Resources