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
Titanium Extended
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="Brownard" data-source="post: 1168250" data-attributes="member: 48291"><p>[USER=145639]@ge2301[/USER] I've managed to fix the problems you were having with closing the hidden side menu. You need to adjust the HiddenMenuItemContainerStyle in styles\OtherControls.xaml so that Button.IsEnabled is bound to ListView.IsEnabled like so:</p><p>[CODE=XML]<Style x:Key="HiddenMenuItemContainerStyle" BasedOn="{ThemeResource DefaultItemContainerStyle}"></p><p> <Setter Property="Template"></p><p> <Setter.Value></p><p> <ControlTemplate TargetType="{x:Type ListViewItem}"></p><p> <Button Style="{ThemeResource ButtonHiddenMenuStyle}"</p><p> Command="{DynamicResource ResourceKey=Menu_Command}"</p><p> IsEnabled="{Binding Enabled}" SetFocus="{Binding Path=Selected,Mode=OneTime}"></p><p> <Button.IsEnabled></p><p> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} &amp;&amp; {1}"></p><p> <!-- Consider the item's enabled state --></p><p> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="IsEnabled"/></p><p> <!-- In combination with the parent ListView's enabled state --></p><p> <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListView}}" Path="IsEnabled"/></p><p> </MultiBinding></p><p> </Button.IsEnabled></p><p> <Button.Triggers></p><p> <Trigger Property="HasFocus" Value="True"></p><p> <Setter TargetName="ButtonControlRectangle" Property="IsVisible" Value="True"/></p><p> <Setter TargetName="ItemLabel" Property="Color" Value="{ThemeResource TextColor}"/></p><p> </Trigger></p><p> </Button.Triggers></p><p> </Button></p><p> </ControlTemplate></p><p> </Setter.Value></p><p> </Setter></p><p></Style>[/CODE]</p><p></p><p>I feel like that ideally this shouldn't be necessary and that it just masks an underlying issue with the focus handling, probably something to do with conflicting SetFocusPrios, but it is how it is implemented in Titanium.</p><p></p><p>I still need to have a go at implementing a MultiTrigger so mouse handling works properly...</p><p></p><p><strong>EDIT</strong></p><p>It works even better if you disable the menu button when the menu is open. That way focus always jumps straight back to the list when pressing right rather than to the menu button first:</p><p>[CODE=XML]<Button x:Name="MenuShowButton" Content="Menu" Style="{ThemeResource ButtonWideStyle_GrowOnly}"</p><p> Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" Height="180" Margin="20,0,0,0"</p><p> IsEnabled="{Binding Source={StaticResource MenuModel},Path=!IsMenuOpen}"</p><p> Command="{Command Source={StaticResource MenuModel}, Path=ToggleMenu}"> </p><p> <Image Source="hiddenmenu_tab.png" Stretch="Uniform" Margin="0,0,0,0"/></p><p></Button>[/CODE]</p></blockquote><p></p>
[QUOTE="Brownard, post: 1168250, member: 48291"] [USER=145639]@ge2301[/USER] I've managed to fix the problems you were having with closing the hidden side menu. You need to adjust the HiddenMenuItemContainerStyle in styles\OtherControls.xaml so that Button.IsEnabled is bound to ListView.IsEnabled like so: [CODE=XML]<Style x:Key="HiddenMenuItemContainerStyle" BasedOn="{ThemeResource DefaultItemContainerStyle}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListViewItem}"> <Button Style="{ThemeResource ButtonHiddenMenuStyle}" Command="{DynamicResource ResourceKey=Menu_Command}" IsEnabled="{Binding Enabled}" SetFocus="{Binding Path=Selected,Mode=OneTime}"> <Button.IsEnabled> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} && {1}"> <!-- Consider the item's enabled state --> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="IsEnabled"/> <!-- In combination with the parent ListView's enabled state --> <Binding RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType={x:Type ListView}}" Path="IsEnabled"/> </MultiBinding> </Button.IsEnabled> <Button.Triggers> <Trigger Property="HasFocus" Value="True"> <Setter TargetName="ButtonControlRectangle" Property="IsVisible" Value="True"/> <Setter TargetName="ItemLabel" Property="Color" Value="{ThemeResource TextColor}"/> </Trigger> </Button.Triggers> </Button> </ControlTemplate> </Setter.Value> </Setter> </Style>[/CODE] I feel like that ideally this shouldn't be necessary and that it just masks an underlying issue with the focus handling, probably something to do with conflicting SetFocusPrios, but it is how it is implemented in Titanium. I still need to have a go at implementing a MultiTrigger so mouse handling works properly... [B]EDIT[/B] It works even better if you disable the menu button when the menu is open. That way focus always jumps straight back to the list when pressing right rather than to the menu button first: [CODE=XML]<Button x:Name="MenuShowButton" Content="Menu" Style="{ThemeResource ButtonWideStyle_GrowOnly}" Grid.Row="0" Grid.Column="0" HorizontalAlignment="Right" Height="180" Margin="20,0,0,0" IsEnabled="{Binding Source={StaticResource MenuModel},Path=!IsMenuOpen}" Command="{Command Source={StaticResource MenuModel}, Path=ToggleMenu}"> <Image Source="hiddenmenu_tab.png" Stretch="Uniform" Margin="0,0,0,0"/> </Button>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Skins and Design
BlueVision
Titanium Extended
Contact us
RSS
Top
Bottom