readonly CLR properties (with no change notification support)
The
WebBrowser
control also has readonly
CLR properties like CanGoBack
. When we get the value of this property, the control looks at its navigation list and determines if there are any pages in the list and returns true
if there are some navigable pages or false
otherwise. Like any other web browser, our web browser needs to support backward navigation, if possible. For this purpose, we want to include a
Back button on the interface. It seems like this would be easy to implement using the
CanGoBack
property. We could use this property in CanExecute
of ICommand
and use an instance of the command for this button. The only issue is that CanGoBack
is readonly
and does not support change notifications.
namespace UsingNonMVVMElements.Command { using System; using System.Windows.Input; using System.Windows.Controls; class GoBackCommand : ICommand { public bool CanExecute(object parameter) { ...