- Admin
- #11
WPF works completely different
@Brownard I gave it a try, but as expected commandbinding didn't work:
@Brownard I gave it a try, but as expected commandbinding didn't work:
XML:
<Button x:Name="PlayPauseButton" Margin="5,0,5,0">
<Button.Style>
<MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} ? {2} : ({1} ? {3})">
<Binding Path="CanPlay"/>
<Binding Path="CanPause"/>
<Binding Source="{ThemeResource PlayButtonStyle}"/>
<Binding Source="{ThemeResource PauseButtonStyle}"/>
</MultiBinding>
</Button.Style>
<Button.Command>
<MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} ? {2} : ({1} ? {3})">
<Binding Path="CanPlay"/>
<Binding Path="CanPause"/>
<Binding Source="{Command Play}"/>
<Binding Source="{Command Pause}"/>
</MultiBinding>
</Button.Command>
<Button.IsVisible>
<MultiBinding Converter="{StaticResource ExpressionMultiValueConverter}" ConverterParameter="{}{0} || {1}">
<Binding Path="CanPlay"/>
<Binding Path="CanPause"/>
</MultiBinding>
</Button.IsVisible>
</Button>