示例#1
0
        void RaiseHyperlinkClick(System.Windows.Documents.Hyperlink hyperlink)
        {
            RoutedEventArgs click = new RoutedEventArgs(System.Windows.Documents.Hyperlink.ClickEvent, hyperlink);

            hyperlink.RaiseEvent(click);
            ICommand command = hyperlink.Command;

            if (command != null && command.CanExecute(hyperlink.CommandParameter) && hyperlink.IsEnabled)
            {
                command.Execute(hyperlink.CommandParameter);
            }
        }
示例#2
0
 public void InternalClick(Hyperlink element)
 {
     Contract.Assert(element != null);
     AssertInputable(element);
     element.RaiseEvent(new RoutedEventArgs(ButtonBase.ClickEvent, element));
 }