1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-30 23:16:09 +00:00
This commit is contained in:
Yan Maniez 2019-04-13 02:36:04 +02:00
parent 6775e03f0f
commit 07c7f2c88b
2 changed files with 28 additions and 21 deletions

View file

@ -19,18 +19,6 @@
<tools:NullToFalseConverter x:Key="NullToFalseConverter" /> <tools:NullToFalseConverter x:Key="NullToFalseConverter" />
</ResourceDictionary> </ResourceDictionary>
</TabbedPage.Resources> </TabbedPage.Resources>
<ContentPage Title="Généralités">
<ScrollView Orientation="Vertical">
<StackLayout>
<Entry Placeholder="Nom" Text="{Binding Name}" Keyboard="Text" />
<!--<Picker Title="Alignement" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Alignments.IsSuccessfullyCompleted}" ItemsSource="{Binding Alignments.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding AlignmentSelectedIndex, Mode=TwoWay}" />-->
<views:ItemPickerView BindingContext="{Binding}" IsEnabled="{Binding Alignments.IsSuccessfullyCompleted}" Title="Alignement" ItemsSource="{Binding Alignments.Result}" SelectedItem="{Binding SelectedAlignment, Mode=TwoWay}" />
<!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.Alignment.Description}" />-->
<Picker Title="Niveau" HorizontalOptions="FillAndExpand" ItemsSource="{Binding Levels}" ItemDisplayBinding="{Binding StringFormat='Niveau : {0}'}" />
</StackLayout>
</ScrollView>
</ContentPage>
<ContentPage Title="Race"> <ContentPage Title="Race">
<ScrollView Orientation="Vertical"> <ScrollView Orientation="Vertical">
<StackLayout> <StackLayout>
@ -59,6 +47,9 @@
<views:ItemPickerView BindingContext="{Binding}" Title="Historique" ItemsSource="{Binding Backgrounds.Result}" SelectedItem="{Binding SelectedBackground, Mode=TwoWay}" /> <views:ItemPickerView BindingContext="{Binding}" Title="Historique" ItemsSource="{Binding Backgrounds.Result}" SelectedItem="{Binding SelectedBackground, Mode=TwoWay}" />
<views:ItemPickerView BindingContext="{Binding}" Title="Variante" ItemsSource="{Binding SubBackgrounds}" SelectedItem="{Binding SelectedSubBackground, Mode=TwoWay}" /> <views:ItemPickerView BindingContext="{Binding}" Title="Variante" ItemsSource="{Binding SubBackgrounds}" SelectedItem="{Binding SelectedSubBackground, Mode=TwoWay}" />
<!-- test -->
<!--<views:StringPickerView BindingContext="{Binding}" IsVisible="{Binding NotifySelectedBackground.IsSuccessfullyCompleted}" Title="Compétences" SelectedItem="{Binding PreferedBackground.Abilities}" />-->
<Frame BorderColor="Black" Padding="2" IsVisible="{Binding NotifySelectedBackground.IsSuccessfullyCompleted}"> <Frame BorderColor="Black" Padding="2" IsVisible="{Binding NotifySelectedBackground.IsSuccessfullyCompleted}">
<StackLayout Padding="0"> <StackLayout Padding="0">
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Compétences" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="# Compétences" />
@ -121,6 +112,18 @@
</StackLayout> </StackLayout>
</ScrollView> </ScrollView>
</ContentPage> </ContentPage>
<ContentPage Title="Finalisation">
<ScrollView Orientation="Vertical">
<StackLayout>
<Entry Placeholder="Nom" Text="{Binding Name}" Keyboard="Text" />
<!--<Picker Title="Alignement" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Alignments.IsSuccessfullyCompleted}" ItemsSource="{Binding Alignments.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding AlignmentSelectedIndex, Mode=TwoWay}" />-->
<views:ItemPickerView BindingContext="{Binding}" IsEnabled="{Binding Alignments.IsSuccessfullyCompleted}" Title="Alignement" ItemsSource="{Binding Alignments.Result}" SelectedItem="{Binding SelectedAlignment, Mode=TwoWay}" />
<!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.Alignment.Description}" />-->
<Picker Title="Niveau" HorizontalOptions="FillAndExpand" ItemsSource="{Binding Levels}" ItemDisplayBinding="{Binding StringFormat='Niveau : {0}'}" />
</StackLayout>
</ScrollView>
</ContentPage>
<ContentPage Title="Résumé"> <ContentPage Title="Résumé">
<ScrollView Orientation="Vertical"> <ScrollView Orientation="Vertical">
<StackLayout> <StackLayout>

View file

@ -86,15 +86,19 @@ namespace AideDeJeu.Views
} }
private async Task<string> ExecuteStringPickerCommandAsync(System.Collections.IEnumerable strings) private async Task<string> ExecuteStringPickerCommandAsync(System.Collections.IEnumerable strings)
{ {
var picker = new Views.StringPicker(); if (strings != null)
var vm = picker.ViewModel; {
vm.Title = Title; var picker = new Views.StringPicker();
vm.Description = Description; var vm = picker.ViewModel;
vm.Items = strings; vm.Title = Title;
await Main.Navigator.Navigation.PushModalAsync(picker, true); vm.Description = Description;
var result = await vm.PickValueAsync(); vm.Items = strings;
await Main.Navigator.Navigation.PopModalAsync(true); await Main.Navigator.Navigation.PushModalAsync(picker, true);
return result; var result = await vm.PickValueAsync();
await Main.Navigator.Navigation.PopModalAsync(true);
return result;
}
return SelectedItem;
} }
} }
} }