c# - DockPanel.Dock="Right" is not working for single control on Maximized window? -


i using dockpanel.dock docking controls @ specific place(i.e left/right). problem controls not docking according dockpanel.dock position.

below code single control dockpanel.dock="right"

    <dockpanel>           <textblock               text            ="left1"               margin          ="5"               dockpanel.dock  ="left"               style           ="{staticresource textblockstyle}"               />           <textblock               text            ="left2"               margin          ="5"               dockpanel.dock  ="left"               style           ="{staticresource textblockstyle}"               />           <textblock               text            ="right1"               margin          ="5"               dockpanel.dock  ="right"               style           ="{staticresource textblockstyle}"               />     </dockpanel> 

enter image description here code multiple controls dockpanel.dock="right"

    <dockpanel>           <textblock               text            ="left1"               margin          ="5"               dockpanel.dock  ="left"               style           ="{staticresource textblockstyle}"               />           <textblock               text            ="left2"               margin          ="5"               dockpanel.dock  ="left"               style           ="{staticresource textblockstyle}"               />           <textblock               text            ="right1"               margin          ="5"               dockpanel.dock  ="right"               style           ="{staticresource textblockstyle}"               />           <textblock               text            ="right2"               margin          ="5"               dockpanel.dock  ="right"               style           ="{staticresource textblockstyle}"               />     </dockpanel> 

enter image description here

expecting output:

enter image description here

any idea or thought appreciated. in advance

you should make use of lastchildfill property:

<dockpanel lastchildfill="false">      <textblock       text            ="left1"       margin          ="5"       dockpanel.dock  ="left"       />      <textblock       text            ="left2"       margin          ="5"       dockpanel.dock  ="left"       />      <stackpanel orientation="horizontal" dockpanel.dock="right">         <textblock       text            ="right1"       margin          ="5"       />     <textblock       text            ="right2"       margin          ="5"       />    </stackpanel>   </dockpanel> 

Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -