Exemple #1
0
 public static void SetState(Hyperlink h, HyperlinkState state, Brush foregroundBrush = null)
 {
     h.TargetName = state.ToString();
     if (state == HyperlinkState.Accent)
     {
         HyperlinkHelper.SetAccentStyleForHyperlink(h);
     }
     else
     {
         HyperlinkHelper.SetAccentStyleForHyperlink(h);
     }
 }
 public static void SetState(Hyperlink h, HyperlinkState state, Brush foregroundBrush = null)
 {
     h.TargetName = (state.ToString());
     if (state != HyperlinkState.Accent)
     {
         if (state == HyperlinkState.MatchForeground)
         {
             HyperlinkHelper.SetForegroundStyleForHyperlink(h, foregroundBrush as SolidColorBrush);
         }
         else
         {
             HyperlinkHelper.SetAccentStyleForHyperlink(h);
         }
     }
     else
     {
         HyperlinkHelper.SetAccentStyleForHyperlink(h);
     }
 }
        public static Hyperlink GenerateHyperlink(string text, string tag, Action <Hyperlink, string> clickedCallback, Brush foregroundBrush = null, HyperlinkState hyperlinkState = HyperlinkState.Normal)
        {
            Hyperlink h = new Hyperlink();

            HyperlinkHelper.SetState(h, hyperlinkState, foregroundBrush);
            PresentationFrameworkCollection <Inline> arg_44_0 = h.Inlines;
            Run expr_3D = new Run();

            expr_3D.Text = (text);
            arg_44_0.Add(expr_3D);
            h.Click += (delegate(object s, RoutedEventArgs e)
            {
                clickedCallback.Invoke(h, tag);
            });
            return(h);
        }