1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-30 15:06:06 +00:00
This commit is contained in:
Yan Maniez 2019-04-12 00:42:48 +02:00
parent 453c07b112
commit b1f7fc9de2
4 changed files with 84 additions and 21 deletions

View file

@ -241,8 +241,17 @@ namespace AideDeJeu.ViewModels
private void SelectedSubBackgroundChanged() private void SelectedSubBackgroundChanged()
{ {
SubBackgroundSpecialties = new NotifyTaskCompletion<List<string>>(Task.Run(() => LoadBackgroundsSpecialtiesAsync(SelectedPlayerCharacter.SubBackground))); if (SelectedPlayerCharacter.SubBackground == null)
Task.Run(async () => SelectedPlayerCharacter.SubBackgroundSkill = await LoadSkillAsync(SelectedPlayerCharacter.SubBackground)); {
SubBackgroundSpecialties = null;
SelectedPlayerCharacter.SubBackgroundSkill = null;
SelectedPlayerCharacter.SubBackgroundSpecialty = null;
}
else
{
SubBackgroundSpecialties = new NotifyTaskCompletion<List<string>>(Task.Run(() => LoadBackgroundsSpecialtiesAsync(SelectedPlayerCharacter.SubBackground)));
Task.Run(async () => SelectedPlayerCharacter.SubBackgroundSkill = await LoadSkillAsync(SelectedPlayerCharacter.SubBackground));
}
} }
private NotifyTaskCompletion<List<string>> _PersonalityTraits = null; private NotifyTaskCompletion<List<string>> _PersonalityTraits = null;
@ -303,6 +312,7 @@ namespace AideDeJeu.ViewModels
private set private set
{ {
SetProperty(ref _BackgroundSpecialties, value); SetProperty(ref _BackgroundSpecialties, value);
OnPropertyChanged(nameof(SelectedBackgroundSpecialties));
} }
} }
private NotifyTaskCompletion<List<string>> _SubBackgroundSpecialties = null; private NotifyTaskCompletion<List<string>> _SubBackgroundSpecialties = null;
@ -315,6 +325,14 @@ namespace AideDeJeu.ViewModels
private set private set
{ {
SetProperty(ref _SubBackgroundSpecialties, value); SetProperty(ref _SubBackgroundSpecialties, value);
OnPropertyChanged(nameof(SelectedBackgroundSpecialties));
}
}
public NotifyTaskCompletion<List<string>> SelectedBackgroundSpecialties
{
get
{
return _SubBackgroundSpecialties ?? _BackgroundSpecialties;
} }
} }

View file

@ -43,6 +43,12 @@ namespace AideDeJeu.ViewModels
SetProperty(ref _Class, value); SetProperty(ref _Class, value);
} }
} }
#region Background
private BackgroundItem _Background = null; private BackgroundItem _Background = null;
public BackgroundItem Background public BackgroundItem Background
{ {
@ -53,6 +59,7 @@ namespace AideDeJeu.ViewModels
set set
{ {
SetProperty(ref _Background, value); SetProperty(ref _Background, value);
OnPropertyChanged(nameof(SelectedBackground));
} }
} }
private SubBackgroundItem _SubBackground = null; private SubBackgroundItem _SubBackground = null;
@ -65,6 +72,14 @@ namespace AideDeJeu.ViewModels
set set
{ {
SetProperty(ref _SubBackground, value); SetProperty(ref _SubBackground, value);
OnPropertyChanged(nameof(SelectedBackground));
}
}
public BackgroundItem SelectedBackground
{
get
{
return _SubBackground ?? _Background;
} }
} }
private string _PersonalityTrait = null; private string _PersonalityTrait = null;
@ -125,6 +140,7 @@ namespace AideDeJeu.ViewModels
set set
{ {
SetProperty(ref _BackgroundSpecialty, value); SetProperty(ref _BackgroundSpecialty, value);
OnPropertyChanged(nameof(SelectedBackgroundSpecialty));
} }
} }
private string _SubBackgroundSpecialty = null; private string _SubBackgroundSpecialty = null;
@ -137,6 +153,14 @@ namespace AideDeJeu.ViewModels
set set
{ {
SetProperty(ref _SubBackgroundSpecialty, value); SetProperty(ref _SubBackgroundSpecialty, value);
OnPropertyChanged(nameof(SelectedBackgroundSpecialty));
}
}
public string SelectedBackgroundSpecialty
{
get
{
return _SubBackgroundSpecialty ?? _BackgroundSpecialty;
} }
} }
private SkillItem _BackgroundSkill = null; private SkillItem _BackgroundSkill = null;
@ -149,6 +173,7 @@ namespace AideDeJeu.ViewModels
set set
{ {
SetProperty(ref _BackgroundSkill, value); SetProperty(ref _BackgroundSkill, value);
OnPropertyChanged(nameof(SelectedBackgroundSkill));
} }
} }
private SkillItem _SubBackgroundSkill = null; private SkillItem _SubBackgroundSkill = null;
@ -161,7 +186,16 @@ namespace AideDeJeu.ViewModels
set set
{ {
SetProperty(ref _SubBackgroundSkill, value); SetProperty(ref _SubBackgroundSkill, value);
OnPropertyChanged(nameof(SelectedBackgroundSkill));
} }
} }
public SkillItem SelectedBackgroundSkill
{
get
{
return _SubBackgroundSkill ?? _BackgroundSkill;
}
}
#endregion Background
} }
} }

View file

@ -50,26 +50,29 @@
<StackLayout> <StackLayout>
<Picker Title="Historique" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Backgrounds.IsSuccessfullyCompleted}" ItemsSource="{Binding Backgrounds.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding BackgroundSelectedIndex, Mode=TwoWay}" /> <Picker Title="Historique" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Backgrounds.IsSuccessfullyCompleted}" ItemsSource="{Binding Backgrounds.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding BackgroundSelectedIndex, Mode=TwoWay}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.Background.Description}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.BackgroundSkill.Name}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.BackgroundSkill.Description}" />
<Button Visual="Material" IsVisible="{Binding BackgroundSpecialties.IsSuccessfullyCompleted}" Text="Spécialité" Command="{Binding BackgroundSpecialtyPickerCommand}" CommandParameter="{Binding BackgroundSpecialties.Result}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.BackgroundSpecialty}" />
<Picker Title="Variante" HorizontalOptions="FillAndExpand" IsEnabled="{Binding SubBackgrounds.IsSuccessfullyCompleted}" ItemsSource="{Binding SubBackgrounds.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding SubBackgroundSelectedIndex, Mode=TwoWay}" /> <Picker Title="Variante" HorizontalOptions="FillAndExpand" IsEnabled="{Binding SubBackgrounds.IsSuccessfullyCompleted}" ItemsSource="{Binding SubBackgrounds.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding SubBackgroundSelectedIndex, Mode=TwoWay}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.Background.Description}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.SubBackground.Description}" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.SubBackground.Description}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SubBackgroundSkill.Name}" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SelectedBackgroundSkill.Name, StringFormat='# {0}'}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SubBackgroundSkill.Description}" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SelectedBackgroundSkill.Description}" />
<Button Visual="Material" IsVisible="{Binding SubBackgroundSpecialties.IsSuccessfullyCompleted}" Text="Spécialité" Command="{Binding SubBackgroundSpecialtyPickerCommand}" CommandParameter="{Binding SubBackgroundSpecialties.Result}" /> <views:StringPickerView BindingContext="{Binding}" Title="{Binding SelectedPlayerCharacter.SelectedBackgroundSpecialty}" ItemsSource="{Binding SelectedBackgroundSpecialties.Result}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SubBackgroundSpecialty}" /> <!--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}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SelectedBackgroundSpecialty}" />-->
<!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SubBackgroundSkill.Name}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SubBackgroundSkill.Description}" />-->
<!--<Button Visual="Material" IsVisible="{Binding SubBackgroundSpecialties.IsSuccessfullyCompleted}" Text="Spécialité" Command="{Binding SubBackgroundSpecialtyPickerCommand}" CommandParameter="{Binding SubBackgroundSpecialties.Result}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.SubBackgroundSpecialty}" />-->
@ -77,16 +80,24 @@
<!--<views:StringPickerView Title="Trait de personnalité" IsVisible="{Binding PersonalityTraits.IsSuccessfullyCompleted}" ItemsSource="{Binding PersonalityTraits.Result}" />--> <!--<views:StringPickerView Title="Trait de personnalité" IsVisible="{Binding PersonalityTraits.IsSuccessfullyCompleted}" ItemsSource="{Binding PersonalityTraits.Result}" />-->
<views:StringPickerView BindingContext="{Binding}" Title="Trait de personnalité" IsVisible="{Binding PersonalityTraits.IsSuccessfullyCompleted}" ItemsSource="{Binding PersonalityTraits.Result}" SelectedItem="{Binding SelectedPlayerCharacter.PersonalityTrait, Mode=TwoWay}" /> <views:StringPickerView BindingContext="{Binding}" Title="Trait de personnalité" IsVisible="{Binding PersonalityTraits.IsSuccessfullyCompleted}" ItemsSource="{Binding PersonalityTraits.Result}" SelectedItem="{Binding SelectedPlayerCharacter.PersonalityTrait, Mode=TwoWay}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityTraits.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityTrait}" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityTraits.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityTrait}" />
<!--SelectedItem="{Binding SelectedPlayerCharacter.PersonalityTrait, Mode=TwoWay}"-->
<Button Visual="Material" IsVisible="{Binding PersonalityIdeals.IsSuccessfullyCompleted}" Text="Idéal" Command="{Binding PersonalityIdealPickerCommand}" CommandParameter="{Binding PersonalityIdeals.Result}" /> <views:StringPickerView BindingContext="{Binding}" Title="Idéal" IsVisible="{Binding PersonalityIdeals.IsSuccessfullyCompleted}" ItemsSource="{Binding PersonalityIdeals.Result}" SelectedItem="{Binding SelectedPlayerCharacter.PersonalityIdeal, Mode=TwoWay}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityIdeals.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityIdeal}" />
<views:StringPickerView BindingContext="{Binding}" Title="Lien" IsVisible="{Binding PersonalityLinks.IsSuccessfullyCompleted}" ItemsSource="{Binding PersonalityLinks.Result}" SelectedItem="{Binding SelectedPlayerCharacter.PersonalityLink, Mode=TwoWay}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityLinks.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityLink}" />
<views:StringPickerView BindingContext="{Binding}" Title="Défaut" IsVisible="{Binding PersonalityDefects.IsSuccessfullyCompleted}" ItemsSource="{Binding PersonalityDefects.Result}" SelectedItem="{Binding SelectedPlayerCharacter.PersonalityDefect, Mode=TwoWay}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityDefects.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityDefect}" />
<!--<Button Visual="Material" IsVisible="{Binding PersonalityIdeals.IsSuccessfullyCompleted}" Text="Idéal" Command="{Binding PersonalityIdealPickerCommand}" CommandParameter="{Binding PersonalityIdeals.Result}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityIdeals.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityIdeal}" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityIdeals.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityIdeal}" />
<Button Visual="Material" IsVisible="{Binding PersonalityLinks.IsSuccessfullyCompleted}" Text="Lien" Command="{Binding PersonalityLinkPickerCommand}" CommandParameter="{Binding PersonalityLinks.Result}" /> <Button Visual="Material" IsVisible="{Binding PersonalityLinks.IsSuccessfullyCompleted}" Text="Lien" Command="{Binding PersonalityLinkPickerCommand}" CommandParameter="{Binding PersonalityLinks.Result}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityLinks.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityLink}" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityLinks.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityLink}" />
<Button Visual="Material" IsVisible="{Binding PersonalityDefects.IsSuccessfullyCompleted}" Text="Défaut" Command="{Binding PersonalityDefectPickerCommand}" CommandParameter="{Binding PersonalityDefects.Result}" /> <Button Visual="Material" IsVisible="{Binding PersonalityDefects.IsSuccessfullyCompleted}" Text="Défaut" Command="{Binding PersonalityDefectPickerCommand}" CommandParameter="{Binding PersonalityDefects.Result}" />
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityDefects.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityDefect}" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" IsVisible="{Binding PersonalityDefects.IsSuccessfullyCompleted}" HorizontalOptions="FillAndExpand" Markdown="{Binding SelectedPlayerCharacter.PersonalityDefect}" />-->
<!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.Background.Markdown}" /> <!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.Background.Markdown}" />

View file

@ -11,7 +11,7 @@
<tools:NullToFalseConverter x:Key="NullToFalseConverter" /> <tools:NullToFalseConverter x:Key="NullToFalseConverter" />
</ResourceDictionary> </ResourceDictionary>
</StackLayout.Resources> </StackLayout.Resources>
<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Title, Source={x:Reference this}, StringFormat='## [{0}](#)'}" IsEnabled="False" /> <mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding Title, Source={x:Reference this}, StringFormat='# {0}'}" IsEnabled="False" />
<!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedItem, Source={x:Reference this}}" />--> <!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedItem, Source={x:Reference this}}" />-->
<!--<StackLayout BindableLayout.ItemsSource="{Binding ItemsSource, Source={x:Reference this}}"> <!--<StackLayout BindableLayout.ItemsSource="{Binding ItemsSource, Source={x:Reference this}}">
<BindableLayout.ItemTemplate> <BindableLayout.ItemTemplate>