home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 2
Skins and Design
BlueVision
Windows 10 Theme for BlueVision skin
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="ge2301" data-source="post: 1155619" data-attributes="member: 145639"><p>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.</p><p></p><p>master_configuration_menu.xaml</p><p>[CODE=XML]<?xml version="1.0" encoding="utf-8"?></p><p> <Include</p><p> xmlns="www.team-mediaportal.com/2008/mpf/directx"</p><p> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"</p><p> Source="screens\master_menu.xaml"></p><p> <Include.Resources></p><p> <ResourceWrapper x:Key="Header_Text"></p><p> [Header text]</p><p> </ResourceWrapper></p><p> <ControlTemplate x:Key="Contents_Template"></p><p> [UI element to be displayed in the content area]</p><p> </ControlTemplate></p><p> </Include.Resources></p><p> </Include></p><p></p><p>Parameters which have to be accessible by a DynamicResource lookup:</p><p>- Header_Text (String): The text to be displayed as header</p><p>- Contents_Template (ConrolTemplate): Template for element to be displayed</p><p> in the content area at the right side</p><p>--></p><p></p><p><Include</p><p> xmlns="www.team-mediaportal.com/2008/mpf/directx"</p><p> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"</p><p> Source="screens\master_bare.xaml"</p><p> xmlns:mp_special_controls="clr-namespace:MediaPortal.UI.SkinEngine.SpecialElements.Controls;assembly=SkinEngine"</p><p> ></p><p> <Include.Resources></p><p></p><p> <ControlTemplate x:Key="Menu_Button_DummyConfig"></p><p> <Button x:Name="MenuButton" Style="{ThemeResource MenuButtonStyle}" Grid.Row="0" Grid.Column="0" Margin="48,-6,2,-32"</p><p> HorizontalAlignment="Center" VerticalAlignment="Center"</p><p> IsEnabled="False"></p><p> </Button></p><p> </ControlTemplate></p><p></p><p> <!-- Defines the default margins for the content area --></p><p> <ResourceWrapper x:Key="DefaultContentMargin" Resource="0" /></p><p></p><p> <!-- Header has to be defined by the includer: "Header_Text" --></p><p></p><p> <!-- Client_Template --></p><p> <ControlTemplate x:Key="Client_Template"></p><p> <DockPanel LastChildFill="True"></p><p> </p><p> <Grid x:Name="LeftPanel" DockPanel.Dock="Left" VerticalAlignment="Stretch" Margin="0,0,-100,0"></p><p> <Grid.ColumnDefinitions></p><p> <ColumnDefinition Width="480"/></p><p> </Grid.ColumnDefinitions></p><p> <Grid.RowDefinitions></p><p> <RowDefinition Height="Auto"/></p><p> <RowDefinition Height="*"/></p><p> <RowDefinition Height="Auto"/></p><p> </Grid.RowDefinitions></p><p> <Grid.Resources></p><p> <Model x:Key="MenuModel" Id="9E9D0CD9-4FDB-4c0f-A0C4-F356E151BDE0"/></p><p> </Grid.Resources></p><p></p><p> <Border Grid.Row="1" Grid.Column="0" Margin="-115,-18,-60,62"></p><p> <Border.Background></p><p> <SolidColorBrush Color="#000000" Opacity="0.85"/></p><p> </Border.Background></p><p> </Border></p><p> <Border Grid.Row="1" Grid.Column="0" Margin="-60,-19,0,61"></p><p> <Border.Background></p><p> <SolidColorBrush Color="Gray" Opacity="1"/></p><p> </Border.Background></p><p> </Border></p><p> <ListView x:Name="MainMenu" Grid.Column="0" Grid.Row="1" Margin="-30,5,0,0" Style="{ThemeResource MainMenuListViewStyle}"</p><p> HorizontalAlignment="Stretch" VerticalAlignment="Stretch" SetFocusPrio="Default"</p><p> ItemsSource="{Binding Source={StaticResource MenuModel},Path=MenuItems,Mode=OneTime}"></p><p> <ListView.Resources></p><p> <CommandBridge x:Key="Menu_Command" Command="{Binding Path=Command,Mode=OneTime}"/></p><p> </ListView.Resources></p><p> </ListView></p><p> </Grid></p><p></p><p> <!-- Order matters here: The content grid has to be the last control to fill the rest of the space --></p><p> <Grid x:Name="ContentPanel" SetFocusPrio="DefaultHigh" Margin="98,0,-57,0"></p><p> <Grid.ColumnDefinitions></p><p> <ColumnDefinition Width="*"/></p><p> </Grid.ColumnDefinitions></p><p> <Grid.RowDefinitions></p><p> <RowDefinition Height="*"/></p><p> </Grid.RowDefinitions></p><p></p><p> <Border Grid.Row="1" Grid.Column="0" Margin="98,-18,-120,62"></p><p> <Border.Background></p><p> <SolidColorBrush Color="#000000" Opacity="0.85"/></p><p> </Border.Background></p><p> </Border></p><p> <Border Grid.Column="0" Grid.Row="0" Margin="0,-19,0,61"></p><p> <Border.Background></p><p> <SolidColorBrush Color="#555555" Opacity="1"/></p><p> </Border.Background></p><p> </Border></p><p></p><p> <Control x:Name="ContentControl" Template="{DynamicResource ResourceKey=Contents_Template}"</p><p> IsVisible="{Binding ElementName=ContentControl,Path=Template,Converter={StaticResource ReferenceToBoolConverter}}"</p><p> Grid.Row="0" Grid.Column="0" Margin="31,5,32,15"/></p><p></p><p> <Control x:Name="AlternativeContentControl" Grid.Row="0" Grid.Column="0" Margin="31,5,32,15"</p><p> VerticalAlignment="Stretch" HorizontalAlignment="Stretch"</p><p> Template="{DynamicResource ResourceKey=Alternative_Contents_Template}"</p><p> IsVisible="{Binding RelativeSource={RelativeSource Self},Path=Template,Converter={StaticResource ReferenceToBoolConverter}}"/></p><p> </Grid></p><p> </DockPanel></p><p> </ControlTemplate></p><p></p><p> <!-- Footer_Template ></p><p> <ControlTemplate x:Key="Alternative_Footer_Template"></p><p> <DockPanel LastChildFill="True"></p><p></p><p> <Grid DockPanel.Dock="Center" VerticalAlignment="Stretch"></p><p> <Grid.ColumnDefinitions></p><p> <ColumnDefinition Width="Auto"/></p><p> </Grid.ColumnDefinitions></p><p> <Grid.RowDefinitions></p><p> <RowDefinition Height="Auto"/></p><p> </Grid.RowDefinitions></p><p> <Grid.Resources></p><p> <Model x:Key="MenuModel" Id="9E9D0CD9-4FDB-4c0f-A0C4-F356E151BDE0"/></p><p> </Grid.Resources></p><p> <Control x:Name="FooterControl" Template="{DynamicResource ResourceKey=Footer_Template}"</p><p> Grid.Row="0" Grid.Column="0" Margin="10,5,10,10"/></p><p> </Grid></p><p> </DockPanel></p><p> </ControlTemplate--></p><p></p><p> </Include.Resources></p><p></Include></p><p>[/CODE]</p><p></p><p>configuration_menu.xaml</p><p>[CODE=XML]<?xml version="1.0" encoding="utf-8"?></p><p><Include</p><p> xmlns="www.team-mediaportal.com/2008/mpf/directx"</p><p> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"</p><p> Source="screens\master_configuration_menu.xaml"</p><p> ></p><p> <Include.Resources></p><p></p><p> <!-- Configuration model --></p><p> <Model x:Key="Model" Id="545674F1-D92A-4383-B6C1-D758CECDBDF5"/></p><p></p><p> <!-- Header --></p><p> <ResourceWrapper x:Key="Header_Text" EnableBindings="True" Resource="{Binding Source={StaticResource Model},Path=HeaderText,Mode=OneTime}"/></p><p></p><p> <!-- Contents --></p><p> <ControlTemplate x:Key="Contents_Template"></p><p> <DockPanel LastChildFill="False"></p><p> <DockPanel LastChildFill="True" DockPanel.Dock="Bottom" Height="120" Margin="20,0,20,20"</p><p> HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></p><p> <Label Color="{ThemeResource HintTextColor}" DockPanel.Dock="Center"</p><p> HorizontalAlignment="Stretch"</p><p> DataContext="{Binding ElementName=ConfigItemsList,Path=CurrentItem}"</p><p> Content="{Binding [Help]}" Wrap="True"</p><p> IsVisible="{Binding Converter={StaticResource ReferenceToBoolConverter}}"/></p><p> </DockPanel></p><p></p><p> <ListView x:Name="ConfigItemsList"</p><p> DockPanel.Dock="Center"</p><p> HorizontalAlignment="Stretch" VerticalAlignment="Stretch"</p><p> Style="{ThemeResource ContentsMenuListViewStyle}"</p><p> DataContext="{Binding Source={StaticResource Model}}"</p><p> ItemsSource="{Binding ConfigSettings}"></p><p> <ListView.Resources></p><p> <CommandBridge x:Key="Menu_Command" Command="{Binding Path=Command,Mode=OneTime}"/></p><p> </ListView.Resources></p><p> </ListView></p><p> <Label DockPanel.Dock="Center" Content="[Configuration.NoSettingsInThisSection]" IsVisible="{Binding ElementName=ConfigItemsList,Path=IsEmpty}"</p><p> HorizontalAlignment="Center" VerticalAlignment="Center"</p><p> Color="{ThemeResource HintTextColor}" FontSize="{ThemeResource SmallFontSize}"/></p><p> </DockPanel></p><p> </ControlTemplate></p><p></p><p> <!--ControlTemplate x:Key="Alternative_Footer_Template"></p><p> <DockPanel LastChildFill="True" Height="120" Margin="0,0,0,0"</p><p> HorizontalAlignment="Stretch" VerticalAlignment="Stretch"></p><p> <Label Color="{ThemeResource HintTextColor}" DockPanel.Dock="Center"</p><p> HorizontalAlignment="Stretch"</p><p> DataContext="{Binding ElementName=ConfigItemsList,Path=CurrentItem}"</p><p> Content="{Binding [Help]}" Wrap="True"</p><p> IsVisible="{Binding Converter={StaticResource ReferenceToBoolConverter}}"/></p><p> </DockPanel></p><p> </ControlTemplate--></p><p> </p><p> </Include.Resources></p><p></Include>[/CODE]</p></blockquote><p></p>
[QUOTE="ge2301, post: 1155619, member: 145639"] 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 [CODE=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> [/CODE] configuration_menu.xaml [CODE=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>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Skins and Design
BlueVision
Windows 10 Theme for BlueVision skin
Contact us
RSS
Top
Bottom