Windows 10 Theme for BlueVision skin (3 Viewers)

ge2301

Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,736
    3,501
    Stuttgart
    Home Country
    Germany Germany
    Only the DataContext="{Binding ElementName=ConfigItemsList,Path=CurrentItem}" is not working.
    Is it not possible to bind an elementname from another control?
    I have checked this. One error is in markup, it needs to be x:Key="Alternative_Footer_Template". But the real issue is, that you cannot address another element by name from within a control template. I have tried to set DataContext to TemplatedParent, didn't help. I tried different ways for binding without success.
    The issue is the name lookup in control: it tries to find the control, then it looks in parent until a INameScope is found. This happens inside template only, not the screen which uses the template.

    This means we would need a backing model for menu item selection where we can bind to from footer. So no immediate solution possible right now :(

    Thanks a lot for checking. Too bad, that a name lookup from a control is not possible :(
    A backing model seems connected to effort. I think priority should be on the CurrentlyPlaying GroupMenu entries at first, because this is a mandatory feature and not "skin cosmetic" :)
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,736
    3,501
    Stuttgart
    Home Country
    Germany Germany
    I have checked this. One error is in markup, it needs to be x:Key="Alternative_Footer_Template".
    I think the code was correct without "Alternative", The Alternative_Footer_template is in master_configuration_menu.xaml and just referring to Footer_template in configuration_menu.xaml. But I didn't show all necessary parts last time, sorry. In the end your final statement would be still correct I think.

    master_configuration_menu.xaml
    XML:
    <?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_menu.xaml">
        <Include.Resources>
          <ResourceWrapper x:Key="Header_Text">
            [Header text]
          </ResourceWrapper>
          <ControlTemplate x:Key="Contents_Template">
            [UI element to be displayed in the content area]
          </ControlTemplate>
        </Include.Resources>
      </Include>
    
    Parameters which have to be accessible by a DynamicResource lookup:
    - Header_Text (String): The text to be displayed as header
    - Contents_Template (ConrolTemplate): Template for element to be displayed
       in the content area at the right side
    -->
    
    <Include
        xmlns="www.team-mediaportal.com/2008/mpf/directx"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Source="screens\master_bare.xaml"
        xmlns:mp_special_controls="clr-namespace:MediaPortal.UI.SkinEngine.SpecialElements.Controls;assembly=SkinEngine"
        >
      <Include.Resources>
    
        <ControlTemplate x:Key="Menu_Button_DummyConfig">
          <Button x:Name="MenuButton" Style="{ThemeResource MenuButtonStyle}" Grid.Row="0" Grid.Column="0" Margin="48,-6,2,-32"
                  HorizontalAlignment="Center" VerticalAlignment="Center"
                  IsEnabled="False">
          </Button>
        </ControlTemplate>
    
        <!-- Defines the default margins for the content area -->
        <ResourceWrapper x:Key="DefaultContentMargin" Resource="0" />
    
        <!-- Header has to be defined by the includer: "Header_Text" -->
    
        <!-- Client_Template -->
        <ControlTemplate x:Key="Client_Template">
          <DockPanel LastChildFill="True">
         
            <Grid x:Name="LeftPanel" DockPanel.Dock="Left" VerticalAlignment="Stretch" Margin="0,0,-100,0">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="480"/>
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <Grid.Resources>
                <Model x:Key="MenuModel" Id="9E9D0CD9-4FDB-4c0f-A0C4-F356E151BDE0"/>
              </Grid.Resources>
    
              <Border Grid.Row="1" Grid.Column="0" Margin="-115,-18,-60,62">
                <Border.Background>
                  <SolidColorBrush Color="#000000" Opacity="0.85"/>
                </Border.Background>
              </Border>
              <Border Grid.Row="1" Grid.Column="0" Margin="-60,-19,0,61">
                <Border.Background>
                  <SolidColorBrush Color="Gray" Opacity="1"/>
                </Border.Background>
              </Border>
              <ListView x:Name="MainMenu" Grid.Column="0" Grid.Row="1" Margin="-30,5,0,0" Style="{ThemeResource MainMenuListViewStyle}"
                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SetFocusPrio="Default"
                  ItemsSource="{Binding Source={StaticResource MenuModel},Path=MenuItems,Mode=OneTime}">
                <ListView.Resources>
                  <CommandBridge x:Key="Menu_Command" Command="{Binding Path=Command,Mode=OneTime}"/>
                </ListView.Resources>
              </ListView>
            </Grid>
    
            <!-- Order matters here: The content grid has to be the last control to fill the rest of the space -->
            <Grid x:Name="ContentPanel" SetFocusPrio="DefaultHigh" Margin="98,0,-57,0">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*"/>
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="*"/>
              </Grid.RowDefinitions>
    
              <Border Grid.Row="1" Grid.Column="0" Margin="98,-18,-120,62">
                <Border.Background>
                  <SolidColorBrush Color="#000000" Opacity="0.85"/>
                </Border.Background>
              </Border>
              <Border Grid.Column="0" Grid.Row="0" Margin="0,-19,0,61">
                <Border.Background>
                  <SolidColorBrush Color="#555555" Opacity="1"/>
                </Border.Background>
              </Border>
    
              <Control x:Name="ContentControl" Template="{DynamicResource ResourceKey=Contents_Template}"
                  IsVisible="{Binding ElementName=ContentControl,Path=Template,Converter={StaticResource ReferenceToBoolConverter}}"
                  Grid.Row="0" Grid.Column="0" Margin="31,5,32,15"/>
    
              <Control x:Name="AlternativeContentControl" Grid.Row="0" Grid.Column="0" Margin="31,5,32,15"
                 VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                 Template="{DynamicResource ResourceKey=Alternative_Contents_Template}"
                 IsVisible="{Binding RelativeSource={RelativeSource Self},Path=Template,Converter={StaticResource ReferenceToBoolConverter}}"/>
            </Grid>
          </DockPanel>
        </ControlTemplate>
    
        <!-- Footer_Template >
        <ControlTemplate x:Key="Alternative_Footer_Template">
          <DockPanel LastChildFill="True">
    
            <Grid DockPanel.Dock="Center" VerticalAlignment="Stretch">
              <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
              </Grid.ColumnDefinitions>
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
              </Grid.RowDefinitions>
              <Grid.Resources>
                <Model x:Key="MenuModel" Id="9E9D0CD9-4FDB-4c0f-A0C4-F356E151BDE0"/>
              </Grid.Resources>
               <Control x:Name="FooterControl" Template="{DynamicResource ResourceKey=Footer_Template}"
                        Grid.Row="0" Grid.Column="0" Margin="10,5,10,10"/>
            </Grid>
          </DockPanel>
        </ControlTemplate-->
    
      </Include.Resources>
    </Include>

    configuration_menu.xaml
    XML:
    <?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_configuration_menu.xaml"
        >
      <Include.Resources>
    
        <!-- Configuration model -->
        <Model x:Key="Model" Id="545674F1-D92A-4383-B6C1-D758CECDBDF5"/>
    
        <!-- Header -->
        <ResourceWrapper x:Key="Header_Text" EnableBindings="True" Resource="{Binding Source={StaticResource Model},Path=HeaderText,Mode=OneTime}"/>
    
        <!-- Contents -->
        <ControlTemplate x:Key="Contents_Template">
          <DockPanel LastChildFill="False">
            <DockPanel LastChildFill="True" DockPanel.Dock="Bottom" Height="120" Margin="20,0,20,20"
                HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Label Color="{ThemeResource HintTextColor}" DockPanel.Dock="Center"
                  HorizontalAlignment="Stretch"
                  DataContext="{Binding ElementName=ConfigItemsList,Path=CurrentItem}"
                  Content="{Binding [Help]}" Wrap="True"
                  IsVisible="{Binding Converter={StaticResource ReferenceToBoolConverter}}"/>
            </DockPanel>
    
            <ListView x:Name="ConfigItemsList"
                DockPanel.Dock="Center"
                HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                Style="{ThemeResource ContentsMenuListViewStyle}"
                DataContext="{Binding Source={StaticResource Model}}"
                ItemsSource="{Binding ConfigSettings}">
              <ListView.Resources>
                <CommandBridge x:Key="Menu_Command" Command="{Binding Path=Command,Mode=OneTime}"/>
              </ListView.Resources>
            </ListView>
            <Label DockPanel.Dock="Center" Content="[Configuration.NoSettingsInThisSection]" IsVisible="{Binding ElementName=ConfigItemsList,Path=IsEmpty}"
                HorizontalAlignment="Center" VerticalAlignment="Center"
                Color="{ThemeResource HintTextColor}" FontSize="{ThemeResource SmallFontSize}"/>
          </DockPanel>
        </ControlTemplate>
    
        <!--ControlTemplate x:Key="Alternative_Footer_Template">
            <DockPanel LastChildFill="True" Height="120" Margin="0,0,0,0"
                HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
              <Label Color="{ThemeResource HintTextColor}" DockPanel.Dock="Center"
                  HorizontalAlignment="Stretch"
                  DataContext="{Binding ElementName=ConfigItemsList,Path=CurrentItem}"
                  Content="{Binding [Help]}" Wrap="True"
                  IsVisible="{Binding Converter={StaticResource ReferenceToBoolConverter}}"/>
            </DockPanel>
        </ControlTemplate-->
      
      </Include.Resources>
    </Include>
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,736
    3,501
    Stuttgart
    Home Country
    Germany Germany
    ... and finally I found a workaround to display the help text in the footer:
    Unbenannt.jpg
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,562
    3,944
    Lehmden
    Home Country
    Germany Germany
    Hi.
    Can you add the white border when selected to the two red Top buttons (power and hidden menu)? Other items has white border what makes it easier to see what is selected. But the two outside ones don't have this useful border...
    And I would like the black bars on top and bottom a bit more transparent. They are too heavy the way they are imho.
     

    ge2301

    Lead Design MP2
  • Team MediaPortal
  • January 11, 2014
    8,736
    3,501
    Stuttgart
    Home Country
    Germany Germany
    Hi.
    Can you add the white border when selected to the two red Top buttons (power and hidden menu)? Other items has white border what makes it easier to see what is selected. But the two outside ones don't have this useful border...
    And I would like the black bars on top and bottom a bit more transparent. They are too heavy the way they are imho.
    Everything you ask for is possible. I'll post some trial screenshots to see how it looks like.
    Actually I prefer more transparent with glass effect, as you know from windows task bar etc. But the effect is missing in MPF
     

    Users who are viewing this thread

    Top Bottom