CommandTarget无法使用WebBrowser Control

时间:2017-01-30 04:44:21

标签: c# .net wpf mvvm

我有两个按钮作为前后和一个webbrowser。 我已将CommandTarget设置为WebBrowser。

   <Button Content="Back" Grid.Column="0" Command="NavigationCommands.BrowseBack" CommandTarget="{Binding ElementName=AppBrowser}"/>
   <Button Content="Forward" Grid.Column="1" Command="NavigationCommands.BrowseForward" CommandTarget="{Binding ElementName=AppBrowser}"/>

但是在浏览器导航中没有启用/禁用后退和前进。

<WebBrowser x:Name="AppBrowser" extension:WebBrowserUtility.BindableSource="{Binding ElementName=TxtAddress,Path=Text}" />

1 个答案:

答案 0 :(得分:0)

将绑定添加到命令中。

 Command="{Binding NavigationCommands.BrowseBack}"
相关问题