I don't know why Image crosses grid right border, how to repair it? Code looks like that:
<Grid>
<Grid Name="grid1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="260" />
<ColumnDefinition Width="640" />
</Grid.ColumnDefinitions>
<Image Grid.Column="1" HorizontalAlignment="Stretch" Margin="0" Name="image1" Stretch="Fill" VerticalAlignment="Stretch" Source="path.png"/>
<ListView Height="361" HorizontalAlignment="Left" Margin="10,10,0,0" Name="listView1" VerticalAlignment="Top" Width="240" ItemsSource="{Binding}" />
<Button Content="Add New Gesture" Height="39" HorizontalAlignment="Left" Margin="10,387,0,0" Name="button1" VerticalAlignment="Top" Width="112" Click="button1_Click" />
<Button Content="Delete" Height="39" HorizontalAlignment="Left" Margin="191,387,0,0" Name="button2" VerticalAlignment="Top" Width="59" />
<Button Content="Modify" Height="39" HorizontalAlignment="Left" Margin="128,387,0,0" Name="button3" VerticalAlignment="Top" Width="57" />
</Grid>
</Grid>
This looks like an effect of the fixed widths you have set (Maybe the sum of your fixed column widths is greater than the fixed window width?) That would cause the grid cell (and image) to go out of the view.
If you want the image to fill the entire space remaining in the window, change your second ColumnDefinition
width to "*"
instead of 640
:
<ColumnDefinition Width="*" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With