Not sure if there is a good alternative in UWP. There is relative panel, but as far as I know there is nothing like <DockPanel LastChildFills="True">
Is this suitable candidate for UWP Community Toolkit?
EDIT: since there already is uservoice, I will not create another: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/17781382-implement-dockpanel
Please vote there
Hi.. why not raise a user voice entry here https://wpdev.uservoice.com/forums/110705-universal-windows-platform and we can gauge the developer interest ?
If you want it to be toolkit specific use this link: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/category/193402-uwp-community-toolkit
If I will contribute and the quality will be excellent, do you need votes on uservoice for this feature in order to accept my PR?
I'm pretty sure quality will be excellent :) But to be sure we are not adding controls in the toolkit that are not used (even if they are excellent) we need to measure the community interest
As you can see here, there is not a big traction: https://wpdev.uservoice.com/forums/110705-universal-windows-platform/suggestions/17781382-implement-dockpanel
But this could also because people are not aware of this entry.
Any reason you cannot use a Grid? I personally find myself using Grids over DockPanels in WPF to help understand the layout when viewing XAML. This also helps future developers understand the layout.
this feels more natural for me:
<DockPanel>
<Button Text="Search" DockPanel.Dock="Right"
<TextBox x:Name="TbxSearch" />
</DockPanel>
than this:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBox x:Name="TbxSearch" />
<Button Text="Search" Grid.Column="1" />
</Grid>
I also like UniformGrid, since its very common UI pattern - columns with equal width.
<UniformGrid Rows="1">
<views:Column1 />
<views:Column2 />
<views:Column3 />
</UniformGrid>
than this:
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<views:Column1 />
<views:Column2 Grid.Column="1" />
<views:Column3 Grid.Column="2" />
</Grid>
UniformGrid is especially useful when using it as ItemsPanelTempalte, because grid does not work here. But maybe there is alternative I don't know about
People are complaining about verbosity of XAML all the time and these small tweeks helps to keep the view cleaner.
@Liero for what it's worth, it's possible RelativePanel might be a replacement for DockPanel in some of your scenarios.
I just found this issue trying to figure out why I don't have DockPanel in UWP. As a dev who's spent years building Windows WPF apps, DockPanel was perhaps only second to StackPanel in terms of the primary tool I use for layout. Perhaps I'm missing something (I'm pretty new to UWP) but RelativePanel seems to require you name everything you want to layout. Naming a bunch of mundane things that don't have any obvious implicit name is just a terrible thing to have to spend your time on.
I think the only reason you're not hearing any one talk about this is that there's a pretty small circle of people doing UWP work and of those, at least some of them have never done any Windows xaml work and probably don't know such a thing as DockPanel even exists.
I got this :)