1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-30 15:06:06 +00:00

Liens directs activés ( merci XF 3.2 ;-) )

This commit is contained in:
Yan Maniez 2018-09-21 23:28:08 +02:00
parent 3142b468b8
commit a8fa48cafe
4 changed files with 3518 additions and 3041 deletions

File diff suppressed because it is too large Load diff

View file

@ -103,48 +103,55 @@
if (links.Any())
{
var blockLinks = links.Distinct().OrderBy(l => l.Key).ToList();
view.GestureRecognizers.Add(new TapGestureRecognizer
if (blockLinks.Count > 1)
{
Command = new Command(async () =>
//view.GestureRecognizers.Add(new TapGestureRecognizer
//{
// Command = new Command(async () =>
// {
// try
// {
// 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);
// NavigateToLinkCommand?.Execute(link.Value);
// }
// catch (Exception) { }
// }),
//});
}
else
{
view.GestureRecognizers.Add(new TapGestureRecognizer
{
try
Command = new Command(() =>
{
if (blockLinks.Count > 1)
try
{
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);
//await NavigateToLink(link.Value);
NavigateToLinkCommand?.Execute(link.Value);
}
else
{
//await NavigateToLink(blockLinks.First().Value);
NavigateToLinkCommand?.Execute(blockLinks.First().Value);
}
}
catch (Exception) { }
}),
});
catch (Exception) { }
}),
});
}
links = new List<KeyValuePair<string, string>>();
}
}
private void AttachLink(Span span, KeyValuePair<string, string> link)
{
//span.GestureRecognizers.Add(new TapGestureRecognizer
//{
// Command = new Command(async () =>
// {
// try
// {
// await NavigateToLink(link.Value);
// }
// catch (Exception)
// {
// }
// }),
//});
span.GestureRecognizers.Add(new TapGestureRecognizer
{
Command = new Command(() =>
{
try
{
NavigateToLinkCommand?.Execute(link.Value);
}
catch (Exception)
{
}
}),
});
}
#region Rendering blocks

View file

@ -72,10 +72,10 @@
IsRunning="{Binding BindingContext.Main.IsLoading, Source={x:Reference This}}"
IsVisible="{Binding BindingContext.Main.IsLoading, Source={x:Reference This}}">
<ActivityIndicator.WidthRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="50" UWP="400" Android="50" />
<OnPlatform x:TypeArguments="x:Double" iOS="50" WinPhone="400" Android="50" />
</ActivityIndicator.WidthRequest>
<ActivityIndicator.HeightRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="50" UWP="10" Android="50" />
<OnPlatform x:TypeArguments="x:Double" iOS="50" WinPhone="10" Android="50" />
</ActivityIndicator.HeightRequest>
</ActivityIndicator>
</Grid>

View file

@ -31,10 +31,10 @@
IsRunning="{Binding BindingContext.Main.IsLoading, Source={x:Reference This}}"
IsVisible="{Binding BindingContext.Main.IsLoading, Source={x:Reference This}}">
<ActivityIndicator.WidthRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="50" UWP="400" Android="50" />
<OnPlatform x:TypeArguments="x:Double" iOS="50" WinPhone="400" Android="50" />
</ActivityIndicator.WidthRequest>
<ActivityIndicator.HeightRequest>
<OnPlatform x:TypeArguments="x:Double" iOS="50" UWP="10" Android="50" />
<OnPlatform x:TypeArguments="x:Double" iOS="50" WinPhone="10" Android="50" />
</ActivityIndicator.HeightRequest>
</ActivityIndicator>
</Grid>