mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-30 15:06:06 +00:00
Ajout début menus déroulants à gauche + liste fonctionnelle avec navigation
This commit is contained in:
parent
bdc0607285
commit
7fa6a79f04
3 changed files with 84 additions and 8 deletions
|
|
@ -13,7 +13,7 @@ namespace AideDeJeu
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
|
|
||||||
|
|
||||||
MainPage = new MainPage();
|
MainPage = new NavigationPage(new MainPage());
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnStart ()
|
protected override void OnStart ()
|
||||||
|
|
|
||||||
|
|
@ -13,13 +13,32 @@
|
||||||
<Button Clicked="OnPlay" Image="ic_play.png" />
|
<Button Clicked="OnPlay" Image="ic_play.png" />
|
||||||
<Button Clicked="OnStop" Image="ic_stop.png" />
|
<Button Clicked="OnStop" Image="ic_stop.png" />
|
||||||
</StackLayout>-->
|
</StackLayout>-->
|
||||||
<ListView x:Name="NavigationView" ItemsSource="{Binding MainMenu}">
|
<!--<ListView x:Name="NavigationView" ItemsSource="{Binding MainMenu}">
|
||||||
<ListView.ItemTemplate>
|
<ListView.ItemTemplate>
|
||||||
<DataTemplate>
|
<DataTemplate>
|
||||||
<TextCell Text="{Binding Title}" TextColor="Black" Command="{Binding Path=BindingContext.OpenUrl, Source={x:Reference Name=This}}" CommandParameter="{Binding Url}" />
|
<TextCell Text="{Binding Title}" TextColor="Black" Command="{Binding Path=BindingContext.OpenUrl, Source={x:Reference Name=This}}" CommandParameter="{Binding Url}" />
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</ListView.ItemTemplate>
|
</ListView.ItemTemplate>
|
||||||
</ListView>
|
</ListView>-->
|
||||||
|
<Label Text="Liste" />
|
||||||
|
<Picker HorizontalOptions="FillAndExpand">
|
||||||
|
<Picker.Items>
|
||||||
|
<x:String>Sorts</x:String>
|
||||||
|
</Picker.Items>
|
||||||
|
</Picker>
|
||||||
|
<Label Text="Classe" />
|
||||||
|
<Picker HorizontalOptions="FillAndExpand">
|
||||||
|
<Picker.Items>
|
||||||
|
<x:String>Barde</x:String>
|
||||||
|
<x:String>Clerc</x:String>
|
||||||
|
<x:String>Druide</x:String>
|
||||||
|
<x:String>Ensorceleur</x:String>
|
||||||
|
<x:String>Magicien</x:String>
|
||||||
|
<x:String>Paladin</x:String>
|
||||||
|
<x:String>Rôdeur</x:String>
|
||||||
|
<x:String>Sorcier</x:String>
|
||||||
|
</Picker.Items>
|
||||||
|
</Picker>
|
||||||
</StackLayout>
|
</StackLayout>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
</MasterDetailPage.Master>
|
</MasterDetailPage.Master>
|
||||||
|
|
@ -41,8 +60,34 @@
|
||||||
<ToolbarItem Text="Inscription" Order="Secondary" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/members/register.aspx" />-->
|
<ToolbarItem Text="Inscription" Order="Secondary" Command="{Binding OpenUrl}" CommandParameter="http://www.pathfinder-fr.org/members/register.aspx" />-->
|
||||||
</ContentPage.ToolbarItems>
|
</ContentPage.ToolbarItems>
|
||||||
<Grid>
|
<Grid>
|
||||||
|
<ListView x:Name="ItemsListView"
|
||||||
|
ItemsSource="{Binding Items}"
|
||||||
|
VerticalOptions="FillAndExpand"
|
||||||
|
HasUnevenRows="true"
|
||||||
|
RefreshCommand="{Binding LoadItemsCommand}"
|
||||||
|
IsPullToRefreshEnabled="true"
|
||||||
|
IsRefreshing="{Binding IsBusy, Mode=OneWay}"
|
||||||
|
CachingStrategy="RecycleElement"
|
||||||
|
ItemSelected="OnItemSelected">
|
||||||
|
<ListView.ItemTemplate>
|
||||||
|
<DataTemplate>
|
||||||
|
<ViewCell>
|
||||||
|
<StackLayout Padding="10">
|
||||||
|
<Label Text="{Binding Text}"
|
||||||
|
LineBreakMode="NoWrap"
|
||||||
|
Style="{DynamicResource ListItemTextStyle}"
|
||||||
|
FontSize="16" />
|
||||||
|
<Label Text="{Binding Description}"
|
||||||
|
LineBreakMode="NoWrap"
|
||||||
|
Style="{DynamicResource ListItemDetailTextStyle}"
|
||||||
|
FontSize="13" />
|
||||||
|
</StackLayout>
|
||||||
|
</ViewCell>
|
||||||
|
</DataTemplate>
|
||||||
|
</ListView.ItemTemplate>
|
||||||
|
</ListView>
|
||||||
<!--<WebView x:Name="MainView" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Navigating="OnNavigating" Source="{Binding Source}" />-->
|
<!--<WebView x:Name="MainView" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand" Navigating="OnNavigating" Source="{Binding Source}" />-->
|
||||||
<ActivityIndicator x:Name="aiProgress" Color="Black" IsRunning="True" IsVisible="True" />
|
<!--<ActivityIndicator x:Name="aiProgress" Color="Black" IsRunning="True" IsVisible="True" />-->
|
||||||
</Grid>
|
</Grid>
|
||||||
</ContentPage>
|
</ContentPage>
|
||||||
</MasterDetailPage.Detail>
|
</MasterDetailPage.Detail>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,6 @@
|
||||||
using System;
|
using AideDeJeu.Models;
|
||||||
|
using AideDeJeu.ViewModels;
|
||||||
|
using System;
|
||||||
|
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
|
|
@ -8,9 +10,38 @@ namespace AideDeJeu.Views
|
||||||
[XamlCompilation(XamlCompilationOptions.Compile)]
|
[XamlCompilation(XamlCompilationOptions.Compile)]
|
||||||
public partial class MainPage : MasterDetailPage //TabbedPage
|
public partial class MainPage : MasterDetailPage //TabbedPage
|
||||||
{
|
{
|
||||||
|
ItemsViewModel viewModel;
|
||||||
|
|
||||||
public MainPage ()
|
public MainPage ()
|
||||||
{
|
{
|
||||||
InitializeComponent ();
|
InitializeComponent ();
|
||||||
|
|
||||||
|
BindingContext = viewModel = new ItemsViewModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
async void OnItemSelected(object sender, SelectedItemChangedEventArgs args)
|
||||||
|
{
|
||||||
|
var item = args.SelectedItem as Item;
|
||||||
|
if (item == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
await Navigation.PushAsync(new ItemDetailPage(new ItemDetailViewModel(item)));
|
||||||
|
|
||||||
|
// Manually deselect item.
|
||||||
|
ItemsListView.SelectedItem = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
async void AddItem_Clicked(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
await Navigation.PushModalAsync(new NavigationPage(new NewItemPage()));
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void OnAppearing()
|
||||||
|
{
|
||||||
|
base.OnAppearing();
|
||||||
|
|
||||||
|
if (viewModel.Items.Count == 0)
|
||||||
|
viewModel.LoadItemsCommand.Execute(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue