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
Submit: Bug Reports
TV Guide Seach button not working
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: 1288776" data-attributes="member: 145639"><p>Next try worked almost, I outsourced most things to a common style, but the datatrigger is not working correctly. In <a href="https://stackoverflow.com/questions/30353611/wpf-button-command-binding-after-trigger-the-propery-changes" target="_blank">WPF </a>this should work.</p><p>[CODE=xml]<Button x:Name="PlayPauseButton" Margin="5,0,5,0" Style="{ThemeResource PlayPauseButtonStyle}"/></p><p></p><p> <Style x:Key="PlayPauseButtonStyle" TargetType="{x:Type Button}"></p><p> <Setter Property="Command" Value="{Command Pause}"/></p><p> <Style.Triggers></p><p> <DataTrigger Binding="CanPlay" Value="True"></p><p> <Setter Property="Command" Value="{Command Play}"/></p><p> </DataTrigger></p><p> </Style.Triggers></p><p> <Setter Property="Template"></p><p> <Setter.Value></p><p> <ControlTemplate TargetType="{x:Type Button}" ></p><p> <Grid></p><p> <Image Source="PlayerControl\PLAY.NOFOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"></p><p> <Image.IsVisible></p><p> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} &amp;&amp; {1}"></p><p> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="!HasFocus"/></p><p> <Binding Path="CanPlay"/></p><p> </MultiBinding></p><p> </Image.IsVisible></p><p> </Image></p><p> <Image Source="PlayerControl\PLAY.FOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"></p><p> <Image.IsVisible></p><p> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} &amp;&amp; {1}"></p><p> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HasFocus"/></p><p> <Binding Path="CanPlay"/></p><p> </MultiBinding></p><p> </Image.IsVisible></p><p> </Image></p><p> <Image Source="PlayerControl\PAUSE.NOFOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"></p><p> <Image.IsVisible></p><p> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} &amp;&amp; {1}"></p><p> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="!HasFocus"/></p><p> <Binding Path="CanPause"/></p><p> </MultiBinding></p><p> </Image.IsVisible></p><p> </Image></p><p> <Image Source="PlayerControl\PAUSE.FOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"></p><p> <Image.IsVisible></p><p> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} &amp;&amp; {1}"></p><p> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HasFocus"/></p><p> <Binding Path="CanPause"/></p><p> </MultiBinding></p><p> </Image.IsVisible></p><p> </Image></p><p> </Grid></p><p> </ControlTemplate></p><p> </Setter.Value></p><p> </Setter></p><p> </Style></p><p>[/CODE]</p><p></p><p>Using the current code and adding focus triggers also does not help:</p><p>[CODE=xml] <Button x:Name="PlayButton" Style="{ThemeResource PlayButtonStyle}" Margin="5,0,5,0" IsVisible="{Binding CanPlay}"</p><p> Command="{Command Play}"></p><p> <Button.Triggers></p><p> <DataTrigger Binding="{Binding ElementName=PauseButton, Path=IsSelected}" Value="True"></p><p> <Setter Property="IsVisible" Value="True"/></p><p> <Setter Property="SetFocus" Value="True"/></p><p> <Setter Property="SetFocusPrio" Value="DefaultHigh"/></p><p> </DataTrigger></p><p> </Button.Triggers></p><p> </Button></p><p> <Button x:Name="PauseButton" Style="{ThemeResource PauseButtonStyle}" Margin="5,0,5,0" IsVisible="{Binding CanPause}"</p><p> Command="{Command Pause}"></p><p> <Button.Triggers></p><p> <DataTrigger Binding="{Binding ElementName=PlayButton, Path=IsSelected}" Value="True"></p><p> <Setter Property="IsVisible" Value="True"/></p><p> <Setter Property="SetFocus" Value="True"/></p><p> <Setter Property="SetFocusPrio" Value="DefaultHigh"/></p><p> </DataTrigger></p><p> </Button.Triggers></p><p> </Button>[/CODE]</p></blockquote><p></p>
[QUOTE="ge2301, post: 1288776, member: 145639"] Next try worked almost, I outsourced most things to a common style, but the datatrigger is not working correctly. In [URL='https://stackoverflow.com/questions/30353611/wpf-button-command-binding-after-trigger-the-propery-changes']WPF [/URL]this should work. [CODE=xml]<Button x:Name="PlayPauseButton" Margin="5,0,5,0" Style="{ThemeResource PlayPauseButtonStyle}"/> <Style x:Key="PlayPauseButtonStyle" TargetType="{x:Type Button}"> <Setter Property="Command" Value="{Command Pause}"/> <Style.Triggers> <DataTrigger Binding="CanPlay" Value="True"> <Setter Property="Command" Value="{Command Play}"/> </DataTrigger> </Style.Triggers> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type Button}" > <Grid> <Image Source="PlayerControl\PLAY.NOFOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"> <Image.IsVisible> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} && {1}"> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="!HasFocus"/> <Binding Path="CanPlay"/> </MultiBinding> </Image.IsVisible> </Image> <Image Source="PlayerControl\PLAY.FOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"> <Image.IsVisible> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} && {1}"> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HasFocus"/> <Binding Path="CanPlay"/> </MultiBinding> </Image.IsVisible> </Image> <Image Source="PlayerControl\PAUSE.NOFOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"> <Image.IsVisible> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} && {1}"> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="!HasFocus"/> <Binding Path="CanPause"/> </MultiBinding> </Image.IsVisible> </Image> <Image Source="PlayerControl\PAUSE.FOCUS.PNG" Stretch="Uniform" Height="45" Width="45" Margin="0" VerticalAlignment="Center"> <Image.IsVisible> <MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} && {1}"> <Binding RelativeSource="{RelativeSource TemplatedParent}" Path="HasFocus"/> <Binding Path="CanPause"/> </MultiBinding> </Image.IsVisible> </Image> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> [/CODE] Using the current code and adding focus triggers also does not help: [CODE=xml] <Button x:Name="PlayButton" Style="{ThemeResource PlayButtonStyle}" Margin="5,0,5,0" IsVisible="{Binding CanPlay}" Command="{Command Play}"> <Button.Triggers> <DataTrigger Binding="{Binding ElementName=PauseButton, Path=IsSelected}" Value="True"> <Setter Property="IsVisible" Value="True"/> <Setter Property="SetFocus" Value="True"/> <Setter Property="SetFocusPrio" Value="DefaultHigh"/> </DataTrigger> </Button.Triggers> </Button> <Button x:Name="PauseButton" Style="{ThemeResource PauseButtonStyle}" Margin="5,0,5,0" IsVisible="{Binding CanPause}" Command="{Command Pause}"> <Button.Triggers> <DataTrigger Binding="{Binding ElementName=PlayButton, Path=IsSelected}" Value="True"> <Setter Property="IsVisible" Value="True"/> <Setter Property="SetFocus" Value="True"/> <Setter Property="SetFocusPrio" Value="DefaultHigh"/> </DataTrigger> </Button.Triggers> </Button>[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 2
Submit: Bug Reports
TV Guide Seach button not working
Contact us
RSS
Top
Bottom