mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-11-01 16:05:42 +00:00
Async
This commit is contained in:
parent
e28a4e419d
commit
86cfa659cc
1 changed files with 5 additions and 4 deletions
|
|
@ -10,10 +10,11 @@
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using Extensions;
|
using Extensions;
|
||||||
using Markdig;
|
using Markdig;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
public class MarkdownView : ContentView
|
public class MarkdownView : ContentView
|
||||||
{
|
{
|
||||||
public Action<string> NavigateToLink { get; set; } = (s) => Device.OpenUri(new Uri(s));
|
public Func<string, Task> NavigateToLink { get; set; } = async(s) => Device.OpenUri(new Uri(s));
|
||||||
|
|
||||||
public static MarkdownTheme Global = new LightMarkdownTheme();
|
public static MarkdownTheme Global = new LightMarkdownTheme();
|
||||||
|
|
||||||
|
|
@ -100,11 +101,11 @@
|
||||||
{
|
{
|
||||||
var result = await Application.Current.MainPage.DisplayActionSheet("Ouvrir le lien", "Annuler", null, blockLinks.Select(x => x.Key).ToArray());
|
var result = await Application.Current.MainPage.DisplayActionSheet("Ouvrir le lien", "Annuler", null, blockLinks.Select(x => x.Key).ToArray());
|
||||||
var link = blockLinks.FirstOrDefault(x => x.Key == result);
|
var link = blockLinks.FirstOrDefault(x => x.Key == result);
|
||||||
NavigateToLink(link.Value);
|
await NavigateToLink(link.Value);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NavigateToLink(blockLinks.First().Value);
|
await NavigateToLink(blockLinks.First().Value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
|
|
@ -123,7 +124,7 @@
|
||||||
// {
|
// {
|
||||||
// try
|
// try
|
||||||
// {
|
// {
|
||||||
// NavigateToLink(link.Value);
|
// await NavigateToLink(link.Value);
|
||||||
// }
|
// }
|
||||||
// catch (Exception)
|
// catch (Exception)
|
||||||
// {
|
// {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue