[WPF系列]-Layout_.NET_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > .NET > [WPF系列]-Layout

[WPF系列]-Layout

 2015/3/19 12:03:35  Look Into Coding  程序员俱乐部  我要评论(0)
  • 摘要:DockPanelThenicethingaboutdockpanelsistheyalreadyfillalltheavailablespace.LastChildFillistruebydefault(butIsetitbelowforclarity),sojustdon'tsettheDockPanelattributeonthelastchild,anditwillfilltheavailablespace.<DockPanelHorizontalAlignment="
  • 标签:

DockPanel

The nice thing about dock panels is they already fill all the available space. LastChildFill is true by default (but I set it below for clarity), so just don't set the DockPanel attribute on the last child, and it will fill the available space.

<DockPanel HorizontalAlignment="Stretch" LastChildFill="true">
    <TextBlock DockPanel.Dock="Left"
               Text="{Binding Path=Name}"
               FontSize="10"
               Foreground="Black" />
    <TextBlock 
               Text="{Binding Path=Price, StringFormat=\{0:C\}}"
               FontSize="10"
               Foreground="Black" />
</DockPanel>

 

WrapPanel

 

StackPanel

 

Grid

 

GridSpilter

上一篇: IOS的UI框架学习 下一篇: 没有下一篇了!
  • 相关文章
发表评论
用户名: 匿名