Stab in the dark is no good :doh: :laugh: I have made some further discoveries on the matter. If I leave the bindings as they are, and add the following code behind to UICardArray
foreach (ContentPresenter content in PART_StackPanel.Children)
{
content.Width = CardWidth;
content.Height = CardHeight;
}
It all works 100% how I would expect it to work, autosized with no clipping. After finding this out I removed this code to its original state and added the following function to UICardArray
public void ShowSizes()
{
foreach (ContentPresenter content in PART_StackPanel.Children)
MessageBox.Show(content.ActualWidth.ToString() + ", " + content.ActualHeight.ToString());
MessageBox.Show(ActualWidth.ToString() + ", " + ActualHeight.ToString());
}
then placed a test array in a test listview and ran the function.
<ListView>
<UserInterface_Elements_Cards:UICardArray x:Name="TestArray" ItemsSource="{Binding Path=TestCards, RelativeSource={RelativeSource AncestorType=Window}}"
DisplayType="HoleCards"
HorizontalAlignment="Center"
CardWidth="18" CardHeight="25"/>
</ListView>
18x25px for each item(4 items), and 78x25px for the entire control (6px for margins between items), yet the listview again stretched the entire available window space. :confused: So I have a workaround for the problem, but I still don't understand what is going on here. Thanks for your help Mark :thumbsup: very much apprecited.