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>
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>
expecting output:
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
Post a Comment