mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 14:35:45 +00:00
Tests
This commit is contained in:
parent
b1bfc390d5
commit
844a0a1c4e
3 changed files with 69 additions and 25 deletions
|
|
@ -13,6 +13,7 @@ using Xamarin.Forms.Xaml;
|
||||||
namespace AideDeJeu.Views.Library
|
namespace AideDeJeu.Views.Library
|
||||||
{
|
{
|
||||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
|
[QueryProperty("Path", "path")]
|
||||||
public partial class ItemPage : ContentPage
|
public partial class ItemPage : ContentPage
|
||||||
{
|
{
|
||||||
public MainViewModel Main
|
public MainViewModel Main
|
||||||
|
|
@ -28,19 +29,26 @@ namespace AideDeJeu.Views.Library
|
||||||
public ItemPage()
|
public ItemPage()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
BindingContext = this.viewModel = new ItemDetailViewModel(new Item()
|
|
||||||
{
|
|
||||||
Name = "Bibliothèque",
|
|
||||||
Id = "index.md",
|
|
||||||
Markdown = AideDeJeu.Tools.Helpers.GetResourceString($"AideDeJeu.Data.index.md"),
|
|
||||||
}
|
}
|
||||||
) { Title = "Bibliothèque" };
|
|
||||||
|
|
||||||
|
protected override void OnAppearing()
|
||||||
|
{
|
||||||
|
base.OnAppearing();
|
||||||
LoadPageAsync();
|
LoadPageAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Path { get; set; } = "l5r_index_hd.md";
|
private string _Path { get; set; } = "index.md";
|
||||||
|
public string Path
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return _Path;
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_Path = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private async Task LoadPageAsync()
|
private async Task LoadPageAsync()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -15,24 +15,47 @@
|
||||||
<FlyoutItem Title="Dés" FlyoutIcon="d20.png">
|
<FlyoutItem Title="Dés" FlyoutIcon="d20.png">
|
||||||
<ShellContent Title="Dés" ContentTemplate="{DataTemplate local:DicesPage}" />
|
<ShellContent Title="Dés" ContentTemplate="{DataTemplate local:DicesPage}" />
|
||||||
</FlyoutItem>
|
</FlyoutItem>
|
||||||
<FlyoutItem Title="Bibliothèque" FlyoutIcon="spell_book.png" FlyoutDisplayOptions="AsMultipleItems">
|
<FlyoutItem Title="Bibliothèque" FlyoutIcon="spell_book.png" Route="data">
|
||||||
<ShellContent Title="Bibliothèque" Icon="spell_book.png" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
<ShellContent Title="Bibliothèque" Icon="spell_book.png" Route="item" ContentTemplate="{DataTemplate library:ItemPage}" />
|
||||||
|
|
||||||
<ShellContent Title="Héros & Dragons" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
|
|
||||||
<ShellContent Title="Manuel des règles" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
<ShellContent Title="Cadre de campagne" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
<ShellContent Title="Créatures et oppositions" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
<ShellContent Title="Les Cinq Royaumes" ContentTemplate="{DataTemplate library:ItemPage}" />
|
|
||||||
|
|
||||||
<ShellContent Title="Livre des monstres" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
<ShellContent Title="Monstrueusement Mignons" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
<ShellContent Title="Joan of Arc" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
<ShellContent Title="SRD" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
|
||||||
</FlyoutItem>
|
</FlyoutItem>
|
||||||
|
<!--<FlyoutItem Title="Héros & Dragons">
|
||||||
|
<ShellContent Title="Héros & Dragons" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="Manuel des règles">
|
||||||
|
<ShellContent Title="Manuel des règles" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="Cadre de campagne">
|
||||||
|
<ShellContent Title="Cadre de campagne" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="Créatures et oppositions">
|
||||||
|
<ShellContent Title="Créatures et oppositions" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="Les Cinq Royaumes" Route="data">
|
||||||
|
<ShellContent Title="Les Cinq Royaumes" Route="l5r_index_hd.md" ContentTemplate="{DataTemplate library:ItemPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="Livre des monstres">
|
||||||
|
<ShellContent Title="Livre des monstres" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="Monstrueusement Mignons">
|
||||||
|
<ShellContent Title="Monstrueusement Mignons" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="Joan of Arc">
|
||||||
|
<ShellContent Title="Joan of Arc" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>
|
||||||
|
<FlyoutItem Title="SRD">
|
||||||
|
<ShellContent Title="SRD" ContentTemplate="{DataTemplate library:ItemDetailPage}" />
|
||||||
|
</FlyoutItem>-->
|
||||||
|
<MenuItem Text="Les Cinq Royaumes"
|
||||||
|
Command="{Binding ShellNavigateCommand}"
|
||||||
|
CommandParameter="//data/item?path=l5r_index_hd.md"
|
||||||
|
/>
|
||||||
<FlyoutItem Title="A propos de..." FlyoutIcon="wooden_sign.png">
|
<FlyoutItem Title="A propos de..." FlyoutIcon="wooden_sign.png">
|
||||||
<ShellContent Title="A propos de..." ContentTemplate="{DataTemplate local:AboutPage}" />
|
<ShellContent Title="A propos de..." ContentTemplate="{DataTemplate local:AboutPage}" />
|
||||||
</FlyoutItem>
|
</FlyoutItem>
|
||||||
|
<MenuItem Text="Test"
|
||||||
|
Command="{Binding ShellNavigateCommand}"
|
||||||
|
CommandParameter="//data/item?path=l5r_index_hd.md"
|
||||||
|
/>
|
||||||
<!--<ShellItem>
|
<!--<ShellItem>
|
||||||
<ShellSection>
|
<ShellSection>
|
||||||
<ShellContent>
|
<ShellContent>
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
|
using System.Windows.Input;
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
||||||
|
|
@ -15,6 +15,19 @@ namespace AideDeJeu.Views
|
||||||
public MainShell()
|
public MainShell()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
BindingContext = this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ICommand ShellNavigateCommand
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return new Command<string>(async(path) => await ExecuteShellNavigateCommandAsync(path));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private async Task ExecuteShellNavigateCommandAsync(string path)
|
||||||
|
{
|
||||||
|
await Shell.Current.GoToAsync(path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue