[no Bug] Does Grid fail to grow by StackPanel-child? (1 Viewer)

chefkoch

Retired Team Member
  • Premium Supporter
  • October 5, 2004
    3,129
    1,634
    Dresden / Munich / Maastricht
    Home Country
    Germany Germany
    I noticed that the StackPanel grows bigger than a parent Grid:
    grid-stack.png


    By using this MPF code:
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <Include
        xmlns="www.team-mediaportal.com/2008/mpf/directx"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Source="screens\master_dialog_bare.xaml"
        >
     
      <Include.Resources>
     
        <!-- Header -->
        <ResourceWrapper x:Key="Dialog_Header_Text" Resource="[ShutdownTimer.Title]"/>
     
        <!-- WeatherSetup model -->
        <Model x:Key="Model" Id="D5513721-92D8-4E45-B988-2C4DBF055B0F"/>
     
        <!-- Contents -->
        <ControlTemplate x:Key="Contents_Template">
          <Grid x:Name="MainGrid"
                HorizontalAlignment="Stretch"
                VerticalAlignment="Stretch"
                DataContext="{Binding Source={StaticResource Model}}">
     
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
     
            <Grid.RowDefinitions>
              <RowDefinition Height="*" />
              <RowDefinition Height="*" />
              <RowDefinition Height="*" />
            </Grid.RowDefinitions>
     
            <Label Grid.Column="0"
                  Grid.Row="0"
                  HorizontalAlignment="Right"
                  VerticalAlignment="Center"
                  Content="Timer: "
                  Color="{ThemeResource TextColor}" />
            <TextBox Grid.Column="1"
                    Grid.Row="0"
                    Margin="10,5,10,5"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Center"
                    BorderThickness="1"
                    Text="120" />
            <Label Grid.Column="2"
                  Grid.Row="0"
                  HorizontalAlignment="Left"
                  VerticalAlignment="Center"
                  Content=" min"
                  Color="{ThemeResource TextColor}" />
     
            <Label Grid.Column="0"
                  Grid.Row="1"
                  HorizontalAlignment="Right"
                  VerticalAlignment="Center"
                  Content="Action: "
                  Color="{ThemeResource TextColor}" />
            <Button Grid.Column="1"
                    Grid.Row="1"
                    Grid.ColumnSpan="2"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Content="Binding CurrentAction" />
     
            <StackPanel Grid.Column="0"
                        Grid.Row="2"
                        Grid.ColumnSpan="3">
              <Button Content="AfterTimeout"
                      Command="{Command ExecuteAfterCustomTimeout}" />
              <Button Content="AfterMediaItem"
                      Command="{Command ExecuteAfterMediaItem}" />
              <Button Content="AfterPlaylist"
                      Command="{Command ExecuteAfterPlaylist}" />
     
              <ListView  HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        ItemsSource="{Binding Path=CustomTimerActions}">
                <!--Style="{ThemeResource ChannelWithLogoAndProgramContainerStyle}"
                      ItemsSource="{Binding Path=CurrentGroupChannels}">-->
                <ListView.Resources>
                  <CommandList x:Key="Menu_Command">
                    <!--<CommandBridge Command="{Binding Path=Command,Mode=OneTime}" />-->
                    <Command Source="{Service ScreenManager}"
                            Path="CloseTopmostDialog" />
                  </CommandList>
                </ListView.Resources>
              </ListView>
            </StackPanel>
          </Grid>
        </ControlTemplate>
     
      </Include.Resources>
    </Include>
     
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Please try "Height=Auto" for the last grid row.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Did this work? We should set this to "no bug" then...
     

    Users who are viewing this thread

    Top Bottom