zoukankan      html  css  js  c++  java
  • WPF listbox WrapPanel Horizontal无效的原因

    http://stackoverflow.com/questions/4244793/listbox-not-showing-items-horizontally-after-using-theme

               <ListBox.ItemsPanel>

    <ItemsPanelTemplate>

    <WrapPane Orientation="Horizontal"l></WrapPanel>

    </ItemsPanelTemplate>

    </ListBox.ItemsPanel>

    无法正常横向显示,原因应用了Theme,修改对应的Theml.xaml

    <ControlTemplate TargetType="{x:Type ListBox}">
    <Grid>
    <Border x:Name="Border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2" Background="{DynamicResource ControlBackgroundBrush}" />
    <ScrollViewer Margin="1" Style="{DynamicResource NuclearScrollViewer}" Focusable="false" Background="{x:Null}">
    <StackPanel Margin="1,1,1,1" IsItemsHost="true" />
    </ScrollViewer>
    </Grid>

    修改 StackPanel to an ItemsPresenter:

    <ItemsPresenter Margin="1,1,1,1"/>






  • 相关阅读:
    AngularJS依赖注入
    transclude 嵌入
    收藏的文章
    mysql
    jquery的deferred对象
    restrict取值
    AngularJs碎片笔记
    js工具函数
    canvas解决画图模糊
    去体湿
  • 原文地址:https://www.cnblogs.com/rock_chen/p/2322537.html
Copyright © 2011-2022 走看看