I ran into a fancy problem. I show the UserControl within the UserControl , and at the moment each contains a completely identical ListView , as in I, copied and pasted from one to the other. A ListView displayed on the parent UserControl , but on the sub- UserControl (no matter what it is called), the ListView columns refuse to stretch to fit their content. I have no idea why this is happening, since the code like ListView exactly the same. Both of them fit directly into the grid.

In the upper left corner is the ListView element from the parent control, and in the lower right - the child control. Here is the code for ListView s:
<ListView ItemsSource="{Binding Adventurers}" Name="AdvListView" HorizontalAlignment="Stretch" Grid.Column="2" Grid.ColumnSpan="1" Grid.Row="2" ScrollViewer.CanContentScroll="False" BorderThickness="3"> <i:Interaction.Triggers> <i:EventTrigger EventName="MouseDoubleClick"> <cmd:EventToCommand Command="{Binding ShowAdvWindowCommand}" CommandParameter="{Binding ElementName=AdvListView, Path=SelectedItem}" PassEventArgsToCommand="False" /> </i:EventTrigger> </i:Interaction.Triggers> <ListView.ItemContainerStyle> <Style TargetType="ListViewItem"> <Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Stretch" /> </Style> </ListView.ItemContainerStyle> <ListView.Resources> <DataTemplate x:Key="NameTemplate"> <TextBlock Grid.Column="1" Grid.Row="0" Text="{Binding Name}" VerticalAlignment="Center" TextTrimming="CharacterEllipsis" /> </DataTemplate> <DataTemplate x:Key="StatusTemplate"> <TextBlock Margin="2,1,1,1" Text="{Binding Status}" VerticalAlignment="Center" /> </DataTemplate> </ListView.Resources> <ListView.View> <GridView> <GridViewColumn Header="Name" CellTemplate="{StaticResource NameTemplate}" /> <GridViewColumn Header="Status" CellTemplate="{StaticResource StatusTemplate}" /> </GridView> </ListView.View> </ListView>
Why would it work on one and not on the other? At the moment I am at a loss.
Update: In the parent UserControl grid layout:
<Grid Background="White"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> //Listview here among other controls </Grid>
The child has:
<Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> </Grid.ColumnDefinitions> <Grid.RowDefinitions> <RowDefinition Height="*" /> </Grid.RowDefinitions> //Listview here </Grid>
Modifying Grid.Row , Grid.Column , RowSpan or ColumnSpan to be correct does not fix the problem.
Update: A little more information that may be relevant: when I try to use Snoop in my program. I get this error:
"BindingFailure detected - assembly with display name" Snoop.XmlSerializers "could not be loaded in the context of the" LoadFrom "AppDomain binding 1. Identifier for failure: System.IO.FileNotFoundException: could not load file or assembly" Snoop.XmlSerializers, Version = 2.8.0.0, Culture = neutral, PublicKeyToken = null "or one of its dependencies. The system cannot find the specified file."
Snoop has no problems with other programs. I do not know if this is due to the problem at all, but I decided that I would send it anyway.
Update: I do not think this would be important, but in order to be thorough, this is where the parent UserControl is created inside the parent:
<Grid> //Other controls <UserControl Grid.Column="3" Grid.Row="3" Visibility="{Binding AdventurerInfoVisibility}"> <view:AdventurerInfoView /> </UserControl> </Grid>
At this moment, I am completely at a standstill. I can create a copy of the ListView in the parent UserControl and display it correctly ... but for some reason it doesn't want to behave in the child UserControl ... I am open to any idea, and if you need more code, I would be more than happy to provide it.