mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Début refonte pc
This commit is contained in:
		
							parent
							
								
									c46212b76e
								
							
						
					
					
						commit
						020ed61657
					
				
					 5 changed files with 129 additions and 128 deletions
				
			
		|  | @ -31,8 +31,6 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
|         } | ||||
| 
 | ||||
|         private async Task ExecuteResetPlayerCharacterCommandAsync() | ||||
|         { | ||||
|             await Task.Run(() => | ||||
|         { | ||||
|             _Random = new Random(DateTime.Now.Millisecond); | ||||
| 
 | ||||
|  | @ -41,10 +39,10 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
| 
 | ||||
| 
 | ||||
|             ResetAlignments(); | ||||
|                 Races = new NotifyTaskCompletion<List<RaceViewModel>>(Task.Run(() => LoadRacesAsync())); | ||||
|                 Classes = new NotifyTaskCompletion<List<ClassViewModel>>(Task.Run(() => LoadClassesAsync())); | ||||
|             Races = await Task.Run(async () => await LoadRacesAsync()); | ||||
|             Classes = await Task.Run(async () => await LoadClassesAsync()); | ||||
| 
 | ||||
|                 Backgrounds = new NotifyTaskCompletion<List<BackgroundItem>>(Task.Run(() => LoadBackgroundsAsync())); | ||||
|             Backgrounds = await Task.Run(async () => await LoadBackgroundsAsync()); | ||||
|             SelectedBackground = null; | ||||
|             //NotifySelectedBackground = new NotifyTaskCompletion<BackgroundItem>(null); | ||||
|             SubBackgrounds = null; | ||||
|  | @ -63,7 +61,6 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
|             BackgroundSpecialty = null; | ||||
|             BackgroundSkill = null; | ||||
|             SubBackgroundSkill = null; | ||||
|             }); | ||||
|         } | ||||
| 
 | ||||
|         public PlayerCharacterEditorViewModel() | ||||
|  | @ -71,7 +68,7 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
|             ExecuteResetPlayerCharacterCommandAsync(); | ||||
|         } | ||||
| 
 | ||||
|         private void SelectedPlayerCharacter_PropertyChanged(object sender, PropertyChangedEventArgs e) | ||||
|         private async void SelectedPlayerCharacter_PropertyChanged(object sender, PropertyChangedEventArgs e) | ||||
|         { | ||||
|             switch (e.PropertyName) | ||||
|             { | ||||
|  | @ -107,6 +104,9 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
| 
 | ||||
|                     SelectedPlayerCharacter.Abilities.Listen(); | ||||
|                     break; | ||||
|                 case nameof(SelectedPlayerCharacter.Background): | ||||
|                     SubBackgrounds = await LoadSubBackgroundsAsync(SelectedPlayerCharacter.Background.Background); | ||||
|                     break; | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  | @ -228,7 +228,9 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
|         #endregion Alignment | ||||
| 
 | ||||
|         #region Race | ||||
|         public NotifyTaskCompletion<List<RaceViewModel>> Races { get; private set; } | ||||
| 
 | ||||
|         private List<RaceViewModel> _Races = null; | ||||
|         public List<RaceViewModel> Races { get { return _Races; } private set { SetProperty(ref _Races, value); } } | ||||
| 
 | ||||
|         public async Task<List<RaceViewModel>> LoadRacesAsync() | ||||
|         { | ||||
|  | @ -258,7 +260,8 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
|         #endregion Race | ||||
| 
 | ||||
|         #region Class | ||||
|         public NotifyTaskCompletion<List<ClassViewModel>> Classes { get; private set; } | ||||
|         private List<ClassViewModel> _Classes = null; | ||||
|         public List<ClassViewModel> Classes { get { return _Classes; } private set { SetProperty(ref _Classes, value); } } | ||||
| 
 | ||||
|         public async Task<List<ClassViewModel>> LoadClassesAsync() | ||||
|         { | ||||
|  | @ -270,7 +273,8 @@ namespace AideDeJeu.ViewModels.PlayerCharacter | |||
|         #endregion Class | ||||
| 
 | ||||
|         #region Background | ||||
|         public NotifyTaskCompletion<List<BackgroundItem>> Backgrounds { get; private set; } | ||||
|         private List<BackgroundItem> _Backgrounds = null; | ||||
|         public List<BackgroundItem> Backgrounds { get { return _Backgrounds; } private set { SetProperty(ref _Backgrounds, value); } } | ||||
| 
 | ||||
|         //private int _BackgroundSelectedIndex = -1; | ||||
|         //public int BackgroundSelectedIndex | ||||
|  |  | |||
|  | @ -20,7 +20,7 @@ | |||
|                 <Label Text="{Binding NotifySelectedBackground.Status, StringFormat='NotifySelectedBackground.Status = {0}'}" /> | ||||
|                 <Label Text="{Binding NotifySelectedSubBackground.Status, StringFormat='NotifySelectedSubBackground.Status = {0}'}" />--> | ||||
| 
 | ||||
|                 <pickers:ItemPickerView BindingContext="{Binding}" Title="Historique" ItemsSource="{Binding Backgrounds.Result}" SelectedItem="{Binding SelectedBackground, Mode=TwoWay}" /> | ||||
|                 <pickers:ItemPickerView BindingContext="{Binding}" Title="Historique" ItemsSource="{Binding Backgrounds}" SelectedItem="{Binding SelectedBackground, Mode=TwoWay}" /> | ||||
|                 <pickers:ItemPickerView BindingContext="{Binding}" Title="Variante" ItemsSource="{Binding SubBackgrounds}" SelectedItem="{Binding SelectedSubBackground, Mode=TwoWay}" IsVisible="{Binding SelectedBackground, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" /> | ||||
| 
 | ||||
|                 <!-- test --> | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ | |||
|     <ContentView.Content> | ||||
|         <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|             <StackLayout> | ||||
|                 <pickers:ItemPickerView BindingContext="{Binding}" Title="Classe" ItemsSource="{Binding Classes.Result}" SelectedItem="{Binding SelectedPlayerCharacter.Class, Mode=TwoWay}" /> | ||||
|                 <pickers:ItemPickerView BindingContext="{Binding}" Title="Classe" ItemsSource="{Binding Classes}" SelectedItem="{Binding SelectedPlayerCharacter.Class, Mode=TwoWay}" /> | ||||
|                 <!--<Picker Title="Classe" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Classes.IsSuccessfullyCompleted}" ItemsSource="{Binding Classes.Result}" ItemDisplayBinding="{Binding Name}"  SelectedIndex="{Binding ClassSelectedIndex, Mode=TwoWay}" />--> | ||||
| 
 | ||||
|                 <Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedPlayerCharacter.Class, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" > | ||||
|  |  | |||
|  | @ -52,9 +52,6 @@ | |||
|             <tools:NullToFalseConverter x:Key="NullToFalseConverter" /> | ||||
|         </ResourceDictionary> | ||||
|     </CarouselPage.Resources> | ||||
|     <!--<CarouselPage.ToolbarItems> | ||||
|         <ToolbarItem Text="Ouvrir en PDF avec..." Command="{Binding GenerateAndOpenPdfCommand}" Order="Secondary" /> | ||||
|     </CarouselPage.ToolbarItems>--> | ||||
|     <ContentPage x:Name="Race" Title="Race"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|  |  | |||
|  | @ -14,7 +14,7 @@ | |||
|     <ContentView.Content> | ||||
|         <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|             <StackLayout> | ||||
|                 <pickers:ItemPickerView BindingContext="{Binding}" Title="Race" ItemsSource="{Binding Races.Result}" SelectedItem="{Binding SelectedPlayerCharacter.Race, Mode=TwoWay}" IsEnabled="{Binding Races.IsSuccessfullyCompleted}" /> | ||||
|                 <pickers:ItemPickerView BindingContext="{Binding}" Title="Race" ItemsSource="{Binding Races}" SelectedItem="{Binding SelectedPlayerCharacter.Race, Mode=TwoWay}" IsEnabled="{Binding Races, Converter={StaticResource NullToFalseConverter}}}" /> | ||||
|                 <!--<Picker Title="Race" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Races.IsSuccessfullyCompleted}" ItemsSource="{Binding Races.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding RaceSelectedIndex, Mode=TwoWay}" />--> | ||||
| 
 | ||||
|                 <Frame BorderColor="Black" Padding="2" Margin="10" IsVisible="{Binding SelectedPlayerCharacter.Race, Converter={StaticResource NullToFalseConverter}, FallbackValue=False}" > | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez