wpf - Dock Panel Dock right and left -
i know little dock panel, following code used:
<dockpanel lastchildfill="true" > <stackpanel orientation="horizontal" dockpanel.dock="top" verticalalignment="center" margin="10" > <stackpanel orientation="horizontal" dockpanel.dock="left" verticalalignment="center" > <textblock height="24" name="welcome" text="welcome" fontsize="14" /> </stackpanel> <stackpanel orientation="horizontal" dockpanel.dock="right" verticalalignment="center" > <textblock height="24" name="welcomee" text="welcomee" fontsize="14" /> </stackpanel> </stackpanel> </dockpanel>
the result this:
welcomewelcomee
however, code must result in this:
welcome welcomee
so please tell me misunderstood concept.
your first stackpanel should not contain other 2 stack panels. contains other two. dockpanel.dock="left"
applies immediate children of dockpanel.
<dockpanel> <stackpanel orientation="horizontal" dockpanel.dock="top" verticalalignment="center" margin="10" >top </stackpanel> <stackpanel orientation="horizontal" dockpanel.dock="left" verticalalignment="center" > <textblock height="24" name="welcome" text="welcome" fontsize="14" /> </stackpanel> <stackpanel orientation="horizontal" dockpanel.dock="right" verticalalignment="center" > <textblock height="24" name="welcomee" text="welcomee" fontsize="14" /> </stackpanel> </dockpanel>
Comments
Post a Comment