I have defined a grid with row and columns:
<Grid Grid.Column="0">
<Grid.RowDefinitions>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<DataGrid Name="dtgPPtab1" Grid.Row="0" FontSize="24" Background="{x:Null}" BorderBrush="Gainsboro" BorderThickness="5" Margin="10" AutoGeneratingColumn="Datagrid_AutoGeneratingColumn" SelectionChanged="Datagrid_SelectionChanged" ></DataGrid>
<StackPanel Name="spPPtab1" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Center">
<Button Name="btPPPlayPause" Content="" Foreground="Lime" FontSize="{StaticResource TEXTBOX_BIGBUTTON_FONTSIZE}" Background="{x:Null}" BorderBrush="{x:Null}" Click="Button_Click"/>
<Button Name="btPPStop" Content="" Visibility="Hidden" Foreground="Red" FontSize="{StaticResource TEXTBOX_BIGBUTTON_FONTSIZE}" Background="{x:Null}" BorderBrush="{x:Null}" Click="Button_Click"/>
</StackPanel>
</Grid>
now I want to set the button btPPPlayPause at the runtime through code this way:
- from hidden to visible
- set a dimension` btPPPlayPause.Width = btPPPlayPause.Height = ...
As far as I know the rowdefinition height = auto should allow correct visualization. Instead what I see is:
- at design time this:
- at runtime time this:
so auto-adaptatin is not working. can anyone tell me why?
Auto
. – StepUp