Adding controls to container
It is probably a stupid question but...
How can i add a control to its container using Cider?, let's say i have a wrappanel how can i drag a control inside it? tried all alternative but got no luck...
It is probably a stupid question but...
How can i add a control to its container using Cider?, let's say i have a wrappanel how can i drag a control inside it? tried all alternative but got no luck...
For Canvas, DockPanel, Grid, StackPanel you should just be able to add the control as you would in Windows Forms using one of the following gestures:
Not yet supported:
For other containers (WrapPanel for instance) the support may currently be a little spotty - I'll take a look at this
mark
And there are no "stupid questions" <g>. Please question away. Feedback on the things we do have working is also welcome
mark
Okay,
So, I have the same stupid question. (Stupid questions do indeed exist. They are the ones you have already heard the answers to, or should already know the answers to . . . ).
Anyhoo.
So, create a new WinFX App and it plops the Window1.xaml there with the codebehind.
Well, all I want to do is to put a Menu there. But no. I first add:
<Grid>
<DockPanel>
</DockPanel>
</Grid>
Okay, now, when I try to put a drop panel into it, it creates the droppanel outside of the droppanel i created.
It does the same thing with a menu.
I have noticed that I have no "docking" thingies highlight like in the demos. I am using Windows Server 2003 R2 64. Could this be the problem?
This is a limitation of the May CTP - in the May CTP you can only use the designer to add and move controls in a Grid control. We decided to focus on improving the overall quality of the product for the May CTP. Part of this decision was to remove features that were in the product as prototype code. You have to use XAML view to do anything with DockPanel.
See http://channel9.msdn.com/wiki/default.aspx/Cider.MayCTPReleaseNotes for more details.
As a matter of interest why are you using a DockPanel rather than a Grid control?
thanks
mark
Perhaps it is just my ignorance or what not, but it seemed the right thing to do?
In short, I have not found any basic VS 2005/XAML tutorials or Cider instructions that illustrate how to do basic Windows Forms, (you know trying to do that whole "Parity" thing. . . ).
The source of the "Menu docked in a DockPanel" was the LNG700-cs.doc lab from the February CTP.
So, just out of curiosity, how do I create a dockable Menu in a Grid? (Standard Windows Forms/Classic Style)
<!-- Menu Bar -->
<DockPanel Name="DockPanel_Menu"
Grid.Column="0"
Grid.ColumnSpan="1"
Grid.Row="0"
Grid.RowSpan="1"
Margin="1,0,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
Width="Auto" Height="28">
<Menu Grid.Column="0" Grid.ColumnSpan="1"
Grid.Row="0" Grid.RowSpan="1"
HorizontalAlignment="Stretch" VerticalAlignment="Top"
Height="25" Background="White">
<MenuItem Header="File">
<MenuItem Header="New Contact" Click="LaunchNewContactWizard"/>
<MenuItem Header="New Group" Click="NotImplementedMsg"/>
<Separator />
>Perhaps it is just my ignorance or what not, but it seemed the right thing to do?
Yes it is. We just don't have support for DockPanel yet. You can create a Menu in the Grid by doing the following:
mark
Hi,
I've had the same doubts as the previous contributor. I've been going through the demos and walkthroughs and I've seen Top Level menus added to a DockPanel root element, a DockPanel within a Grid as the root element and a StackPanel. Could you confirm which is the best practice when adding a Top Level menu to a window to just get the ball rolling.
Sean