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

Avec description

This commit is contained in:
Yan Maniez 2019-04-12 11:34:06 +02:00
parent ce7a2ad49f
commit f2852eee7b
4 changed files with 30 additions and 3 deletions

View file

@ -20,6 +20,19 @@ namespace AideDeJeu.ViewModels
}
}
private string _Description = null;
public string Description
{
get
{
return _Description;
}
set
{
SetProperty(ref _Description, value);
}
}
private System.Collections.IEnumerable _Items = null;
public System.Collections.IEnumerable Items
{

View file

@ -59,9 +59,8 @@
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SelectedBackgroundSkill.Name, StringFormat='# {0}'}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SelectedBackgroundSkill.Description}" />
<views:StringPickerView BindingContext="{Binding}" Title="{Binding SelectedBackgroundSpecialties.Result.Name}" ItemsSource="{Binding SelectedBackgroundSpecialties.Result.BindableTable}" SelectedItem="{Binding SelectedPlayerCharacter.PickedBackgroundSpecialty, Mode=TwoWay}" />
<views:StringPickerView BindingContext="{Binding}" Title="{Binding SelectedBackgroundSpecialties.Result.Name}" Description="{Binding SelectedBackgroundSpecialties.Result.Description}" ItemsSource="{Binding SelectedBackgroundSpecialties.Result.BindableTable}" SelectedItem="{Binding SelectedPlayerCharacter.PickedBackgroundSpecialty, Mode=TwoWay}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PickedBackgroundSpecialty}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedBackgroundSpecialties.Result.Description}" />
<!--SelectedItem="{Binding SelectedPlayerCharacter.SelectedBackgroundSpecialty, Mode=TwoWay}"-->
<!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityTraits.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityTrait}" />
<Button Visual="Material" IsVisible="{Binding SelectedBackgroundSpecialties.IsSuccessfullyCompleted}" Text="Spécialité" Command="{Binding BackgroundSpecialtyPickerCommand}" CommandParameter="{Binding SelectedBackgroundSpecialties.Result}" />

View file

@ -14,7 +14,10 @@
<ContentPage.Content>
<ListView ItemsSource="{Binding Items}" HasUnevenRows="True" SelectedItem="{Binding SelectedItem, Mode=TwoWay}">
<ListView.Header>
<StackLayout>
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding Title, StringFormat='# {0}'}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding Description}" />
</StackLayout>
</ListView.Header>
<ListView.ItemTemplate>
<DataTemplate>

View file

@ -37,6 +37,17 @@ namespace AideDeJeu.Views
typeof(StringPickerView),
defaultValue: default(string));
public string Description
{
get { return (string)GetValue(DescriptionProperty); }
set { SetValue(DescriptionProperty, value); }
}
public static readonly BindableProperty DescriptionProperty = BindableProperty.Create(
nameof(Description),
typeof(string),
typeof(StringPickerView),
defaultValue: default(string));
public string SelectedItem
{
get { return (string)GetValue(SelectedItemProperty); }
@ -78,6 +89,7 @@ namespace AideDeJeu.Views
var picker = new Views.StringPicker();
var vm = picker.ViewModel;
vm.Title = Title;
vm.Description = Description;
vm.Items = strings;
await Main.Navigator.Navigation.PushModalAsync(picker, true);
var result = await vm.PickValueAsync();