mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-12-16 23:29:47 +00:00
Test multilien + correctif null pointer
This commit is contained in:
parent
9c629b4fcc
commit
6a8ee5f49c
2 changed files with 26 additions and 16 deletions
|
|
@ -161,21 +161,30 @@ namespace AideDeJeu.ViewModels
|
|||
|
||||
public async Task NavigateToLink(string s)
|
||||
{
|
||||
var regex = new Regex("/(?<file>.*)\\.md#(?<anchor>.*)");
|
||||
var match = regex.Match(s);
|
||||
var file = match.Groups["file"].Value;
|
||||
var anchor = match.Groups["anchor"].Value;
|
||||
if (file == "spells_hd")
|
||||
if (s != null)
|
||||
{
|
||||
var spells = await GetItemsViewModel(ItemSourceType.SpellHD).GetAllItemsAsync();
|
||||
var spell = spells.Where(i => i.Id == anchor).FirstOrDefault();
|
||||
await Navigator.GotoSpellDetailPageAsync(spell);
|
||||
}
|
||||
else if (file == "monsters_hd")
|
||||
{
|
||||
var monsters = await GetItemsViewModel(ItemSourceType.MonsterHD).GetAllItemsAsync();
|
||||
var monster = monsters.Where(i => i.Id == anchor).FirstOrDefault();
|
||||
await Navigator.GotoMonsterDetailPageAsync(monster);
|
||||
var regex = new Regex("/(?<file>.*)\\.md#(?<anchor>.*)");
|
||||
var match = regex.Match(s);
|
||||
var file = match.Groups["file"].Value;
|
||||
var anchor = match.Groups["anchor"].Value;
|
||||
if (file == "spells_hd")
|
||||
{
|
||||
var spells = await GetItemsViewModel(ItemSourceType.SpellHD).GetAllItemsAsync();
|
||||
var spell = spells.Where(i => i.Id == anchor).FirstOrDefault();
|
||||
if (spell != null)
|
||||
{
|
||||
await Navigator.GotoSpellDetailPageAsync(spell);
|
||||
}
|
||||
}
|
||||
else if (file == "monsters_hd")
|
||||
{
|
||||
var monsters = await GetItemsViewModel(ItemSourceType.MonsterHD).GetAllItemsAsync();
|
||||
var monster = monsters.Where(i => i.Id == anchor).FirstOrDefault();
|
||||
if (monster != null)
|
||||
{
|
||||
await Navigator.GotoMonsterDetailPageAsync(monster);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue