From 1183cb62ecd2f11ca79e7157373e019b01da0b5d Mon Sep 17 00:00:00 2001 From: Yan Maniez Date: Fri, 3 Aug 2018 20:55:56 +0200 Subject: [PATCH] =?UTF-8?q?Pr=C3=A9paration=20links=20pour=20Xamarin.Forms?= =?UTF-8?q?=203.2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AideDeJeu/MarkdownView/MarkdownView.cs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs b/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs index 1a9ba42c..813b12dd 100644 --- a/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs +++ b/AideDeJeu/AideDeJeu/MarkdownView/MarkdownView.cs @@ -115,6 +115,23 @@ } } + private void AttachLink(Span span, KeyValuePair link) + { + //span.GestureRecognizers.Add(new TapGestureRecognizer + //{ + // Command = new Command(async () => + // { + // try + // { + // NavigateToLink(link.Value); + // } + // catch (Exception) + // { + // } + // }), + //}); + } + #region Rendering blocks private void Render(Block block) @@ -536,6 +553,11 @@ else { var spans = link.SelectMany(x => CreateSpans(x, this.Theme.Link.FontFamily ?? family, attributes| this.Theme.Link.Attributes, this.Theme.Link.ForegroundColor, this.Theme.Link.BackgroundColor, size)).ToArray(); + //var newlink = new KeyValuePair(string.Join("", spans.Select(x => x.Text)), url); + //foreach (var span in spans) + //{ + // AttachLink(span, newlink); + //} links.Add(new KeyValuePair(string.Join("",spans.Select(x => x.Text)), url)); return spans; }