ListBoxItem Horizo​​ntalContentAlignment将覆盖大都会风格

时间:2012-03-18 20:04:18

标签: silverlight listbox styles listitem stretch

我正在寻找一种解决办法,让我的ListBox项目可以拉伸ListBox的整个宽度。

我找到了以下解决方案但是当我将它添加到我的xaml代码时,它会覆盖我在整个应用程序中使用的国际化主题使用的样式,因此看起来不正确。

<ListBox...>
    <ListBox.Resources>
        <Style TargetType="ListBoxItem">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        </Style>
    </ListBox.Resources>
</ListBox>

有没有办法在不影响风格的情况下这样做? 我在某处看到我可能需要将ListBox项宽度绑定到ListBox的实际宽度?

感谢。

0 个答案:

没有答案
相关问题