Let me show you some of my XAML code:
<ListBox Grid.Row="1" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.IsDeferredScrollingEnabled="True" HorizontalAlignment="Stretch" ItemsSource="{Binding}" Margin="1,1,0,0" Name="listBox_Faits" Width="290" VerticalAlignment="Stretch" SelectionChanged="listBox_Faits_SelectionChanged"> <ListBox.ItemTemplate> <DataTemplate> <Border BorderBrush="SlateGray" BorderThickness="0.5" Margin="1,2,1,1" Width="{Binding ElementName=listBox_Faits, Path=Width}">
When too many borders are created (it is associated with an ObservableCollection), a vertical scrollbar appears, and my border does not change on its own. (I would like to see the full border, I do not want it to be cut at the end)
If anyone has an idea, thanks! Feel free to ask if you need more information!
Rgds,
Flo
c # resize wpf border datatemplate
Flo
source share