Why does this throw an error and how can I fix... I need to set the clipping rect to be dynamic.
<Grid.ColumnDefinitions>
<ColumnDefinition Width="42"/>
<ColumnDefinition x:Name="ListBoxContainer" Width="*"/>
<ColumnDefinition Width="42"/>
</Grid.ColumnDefinitions>
<Canvas>
<Button x:Name="btnGalleryLeft"
Click="btnGalleryLeftClick"
Style="{StaticResource GalleryNavigationLeft}"
Canvas.Left="7"
Canvas.Top="50" />
</Canvas>
<Canvas Grid.Column="1" x:Name="ListboxWrapper">
<Canvas.Clip>
<RectangleGeometry>
<RectangleGeometry.Rect>
<Rect X="0" Y="0"
Width="{Binding ElementName=ListBoxContainer, Path=Width}"
Height="{Binding ElementName=ListBoxContainer, Path=Height}"/>
</RectangleGeometry.Rect>
</RectangleGeometry>
</Canvas.Clip>
<ListBox x:Name="ListBox1"
Margin="15, 18, 15, 0"
Style="{StaticResource GalleryListBoxStyle}"
ItemsSource="{Binding DocItemCollection}"
SelectionChanged="ListBox_SelectionChanged"
MouseLeftButtonUp="ListBox_MouseLeftButtonUp"
Canvas.Top="0"
Canvas.Left="0"
/>
</Canvas>
<Canvas Grid.Column="2">
<Button x:Name="btnGalleryRight"
Click="btnGalleryRightClick"
Style="{StaticResource GalleryNavigationRight}"
Margin="0, 0, 7, 0"
Canvas.Top="50" />