を使用して列のIMultiValueConverterをバインドし、残りのスペースをすべて埋めるようにします。WidthListView
私はListView'sにバインドしているので、これには垂直スクロールバー(に設定されている)ActualWidthが占める幅も含まれます。VisibilityAuto
ListView'sのViewPort幅(つまり、の幅からListView垂直スクロールバーの幅を引いたもの)を取得したいと思います。
この他のSOの質問で提案されているようにバインディングを試しましたが、常に。を取得し{DependencyProperty.UnsetValue}ます。
</GridViewColumn.Width>
<MultiBinding Converter="{StaticResource widthConverter}">
<Binding ElementName="lstResults" Path="ActualWidth" NotifyOnSourceUpdated="True" />
<Binding ElementName="colPartNo" Path="ActualWidth" NotifyOnSourceUpdated="True" />
<Binding RelativeSource="{RelativeSource Mode=FindAncestor, AncestorType=ScrollViewer}" Path="ViewportWidth" NotifyOnSourceUpdated="True"/>
</MultiBinding>
</GridViewColumn.Width>
サイズ変更が必要な列は、ListView.View内に含まれるGridView内にあります。
よろしくお願いします。