I'm trying to show the following, depending on the shape of the image (the blue block):
I'm having a few problems:
MinWidth="500"
)Window attributes:
WindowStartupLocation="Manual"
Top="100"
Left="100"
Width="700"
SizeToContent="Height"
ResizeMode="CanResize"
MaxWidth="{x:Static SystemParameters.PrimaryScreenWidth}"
MaxHeight="{x:Static SystemParameters.PrimaryScreenHeight}"
Image, text and buttons:
<StackPanel VerticalAlignment="Bottom" Margin="10">
<Image Name="IW" VerticalAlignment="Center" Source="{Binding Image}" />
<TextBlock Margin="0,10,0,10" HorizontalAlignment="Stretch" Background="{StaticResource Container2}">
<TextBlock Margin="10" TextWrapping="Wrap" FontSize="{Binding FontSize}" Foreground="{StaticResource PrimaryText}" Background="{StaticResource Container2}" Text="{Binding Text}"/>
</TextBlock>
<StackPanel Orientation="Horizontal" Width="auto" HorizontalAlignment="Right">
<Button Visibility="{Binding YesVisibility}" x:Name="YES" Margin="0,0,20,0" Height="40" Width="150" FontSize="22" FontWeight="DemiBold" Content="YES" Foreground="{StaticResource CTAPrimary2}" Click="Button_Click"/>
<Button Visibility="{Binding NoVisibility}" x:Name="NO" Margin="0,0,20,0" Height="40" Width="150" FontSize="22" FontWeight="DemiBold" Content="NO" Foreground="{StaticResource CTAPrimary2}" Click="Button_Click"/>
<Button Visibility="{Binding ContinueVisibility}" x:Name="CONTINUE" Margin="0,0,20,0" Height="40" Width="150" FontSize="22" FontWeight="DemiBold" Content="CONTINUE" Foreground="{StaticResource CTAPrimary2}" Click="Button_Click"/>
<Button Visibility="{Binding ExitVisibility}" x:Name="EXIT" Margin="0,0,0,0" Height="40" Width="150" FontSize="22" FontWeight="DemiBold" Content="EXIT" Foreground="{StaticResource PrimaryText}" Click="Button_Click"/>
</StackPanel>
</StackPanel>
Use a Grid as top level layout Panel:
<Grid>
<Grid.RowDefinitions>
<RowDefinition/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Image Grid.Row="0" Source="{Binding Image}"/>
<TextBlock Grid.Row="1" Text="{Binding Text}" .../>
<StackPanel Grid.Row="2" Orientation="Horizontal"
Margin="20" HorizontalAlignment="Right">
<Button .../>
<Button .../>
<Button .../>
<Button .../>
</StackPanel>
</Grid>