基本的な空のプロジェクトでC#WPFの学習を始めたばかりで、ウィンドウ全体に正確に広がる背景画像を使用してグリッドを作成したいと思います。
現在のように、グリッドは伸びますが、私が望む方法ではありません。たとえば、背景画像が1000x1000pxで、ウィンドウサイズが1700x1200pxなので、グリッドが1200x1200pxに拡大します(画像のアスペクト比が維持されます。これは必要ありません。単にウィンドウ全体に拡大したいのです。
これが私のコードです:
<Window x:Class="Backgammon.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="auto" Width="auto">
<Grid VerticalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="auto" MinWidth="510" />
</Grid.ColumnDefinitions>
<Image Source="C:\Users\Edy\Pictures\cool-wallpapers1.jpg" Stretch="UniformToFill" HorizontalAlignment="Left"></Image>
<Button Height="33" HorizontalAlignment="Right" Margin="0,0,12,12" Name="button1" VerticalAlignment="Bottom" Width="145" Click="button1_Click" ClipToBounds="False">Connect</Button>
<ListBox Margin="12,12,0,149" Name="listBox1" HorizontalAlignment="Left" Width="225" />
</Grid>
どんな助けでも素晴らしいでしょう、ありがとう。