mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +00:00 
			
		
		
		
	Test + OrderBy
This commit is contained in:
		
							parent
							
								
									00dd85ee3f
								
							
						
					
					
						commit
						965ffea7ba
					
				
					 4 changed files with 49 additions and 6 deletions
				
			
		|  | @ -6,19 +6,21 @@ namespace AideDeJeu.Tools | ||||||
| { | { | ||||||
|     public class NotifyTaskCompletion<TResult> : INotifyPropertyChanged |     public class NotifyTaskCompletion<TResult> : INotifyPropertyChanged | ||||||
|     { |     { | ||||||
|         public NotifyTaskCompletion(Task<TResult> task) |         private bool ContinueOnCapturedContext = false; | ||||||
|  |         public NotifyTaskCompletion(Task<TResult> task, bool continueOnCapturedContext = false) | ||||||
|         { |         { | ||||||
|             Task = task; |             Task = task; | ||||||
|  |             ContinueOnCapturedContext = continueOnCapturedContext; | ||||||
|             if (task != null && !task.IsCompleted) |             if (task != null && !task.IsCompleted) | ||||||
|             { |             { | ||||||
|                 var _ = WatchTaskAsync(task); |                 var _ = WatchTaskAsync(task, continueOnCapturedContext); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         private async Task WatchTaskAsync(Task task) |         private async Task WatchTaskAsync(Task task, bool continueOnCapturedContext = false) | ||||||
|         { |         { | ||||||
|             try |             try | ||||||
|             { |             { | ||||||
|                 await task.ConfigureAwait(false); |                 await task.ConfigureAwait(continueOnCapturedContext); | ||||||
|             } |             } | ||||||
|             catch |             catch | ||||||
|             { |             { | ||||||
|  |  | ||||||
|  | @ -1,4 +1,5 @@ | ||||||
| using AideDeJeu.Views; | using AideDeJeu.Tools; | ||||||
|  | using AideDeJeu.Views; | ||||||
| using AideDeJeuLib; | using AideDeJeuLib; | ||||||
| using Rg.Plugins.Popup.Services; | using Rg.Plugins.Popup.Services; | ||||||
| using System; | using System; | ||||||
|  | @ -48,10 +49,31 @@ namespace AideDeJeu.ViewModels | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         //private NotifyTaskCompletion<bool> _TestNotify = null; | ||||||
|  |         //public NotifyTaskCompletion<bool> TestNotify | ||||||
|  |         //{ | ||||||
|  |         //    get | ||||||
|  |         //    { | ||||||
|  |         //        return _TestNotify; | ||||||
|  |         //    } | ||||||
|  |         //    set | ||||||
|  |         //    { | ||||||
|  |         //        SetProperty(ref _TestNotify, value); | ||||||
|  |         //    } | ||||||
|  |         //} | ||||||
|  | 
 | ||||||
|  |         //public async Task<bool> TestGotoAsync() | ||||||
|  |         //{ | ||||||
|  |         //    var page = new Views.MainTabbedPage(); | ||||||
|  |         //    Device.BeginInvokeOnMainThread(async() =>  | ||||||
|  |         //    await Navigation.PushAsync(page, true)); | ||||||
|  |         //    return true; | ||||||
|  |         //} | ||||||
|         public async Task GotoLibraryPageAsync() |         public async Task GotoLibraryPageAsync() | ||||||
|         { |         { | ||||||
|             //await Navigation.PushAsync(new Views.ItemDetailPage(),true); |             //await Navigation.PushAsync(new Views.ItemDetailPage(),true); | ||||||
|             await Navigation.PushAsync(new Views.MainTabbedPage(), true); |             await Navigation.PushAsync(new Views.MainTabbedPage(), true); | ||||||
|  |             //TestNotify = new NotifyTaskCompletion<bool>(TestGotoAsync(), true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         private Command _BookmarksCommand = null; |         private Command _BookmarksCommand = null; | ||||||
|  |  | ||||||
|  | @ -252,7 +252,7 @@ namespace AideDeJeu.ViewModels | ||||||
|                         expandedRaces.Add(new ExpandedRaceItem() { Race = race, SubRace = null }); |                         expandedRaces.Add(new ExpandedRaceItem() { Race = race, SubRace = null }); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|                 return expandedRaces; |                 return expandedRaces.OrderBy(r => Tools.Helpers.RemoveDiacritics(r.Name)).ToList(); | ||||||
|                 //return await context.Races.Where(r => !r.HasSubRaces).OrderBy(r => Tools.Helpers.RemoveDiacritics(r.Name)).ToListAsync().ConfigureAwait(false); |                 //return await context.Races.Where(r => !r.HasSubRaces).OrderBy(r => Tools.Helpers.RemoveDiacritics(r.Name)).ToListAsync().ConfigureAwait(false); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  |  | ||||||
|  | @ -65,7 +65,26 @@ | ||||||
|     <ContentPage.Content> |     <ContentPage.Content> | ||||||
|         <ScrollView> |         <ScrollView> | ||||||
|             <FlexLayout> |             <FlexLayout> | ||||||
|  |                 <!--<ActivityIndicator  | ||||||
|  |                             VerticalOptions="StartAndExpand" | ||||||
|  |                             HorizontalOptions="End" | ||||||
|  |                             Color="{StaticResource HDRed}" | ||||||
|  |                             IsVisible="{Binding Main.Navigator.TestNotify.IsNotCompleted, FallbackValue=False}" IsRunning="{Binding Main.Navigator.TestNotify.IsNotCompleted, FallbackValue=False}" > | ||||||
|  |                     <ActivityIndicator.WidthRequest> | ||||||
|  |                         <OnPlatform x:TypeArguments="x:Double"> | ||||||
|  |                             <On Platform="UWP" Value="400" /> | ||||||
|  |                             <On Platform="iOS, Android" Value="50" /> | ||||||
|  |                         </OnPlatform> | ||||||
|  |                     </ActivityIndicator.WidthRequest> | ||||||
|  |                     <ActivityIndicator.HeightRequest> | ||||||
|  |                         <OnPlatform x:TypeArguments="x:Double"> | ||||||
|  |                             <On Platform="UWP" Value="10" /> | ||||||
|  |                             <On Platform="iOS, Android" Value="50" /> | ||||||
|  |                         </OnPlatform> | ||||||
|  |                     </ActivityIndicator.HeightRequest> | ||||||
|  |                 </ActivityIndicator>--> | ||||||
|                 <Label Text="{Binding Main.DebugCount.Result, StringFormat='Count : {0}'}" TextColor="Transparent" /> |                 <Label Text="{Binding Main.DebugCount.Result, StringFormat='Count : {0}'}" TextColor="Transparent" /> | ||||||
|  |                 <!--<Label Text="{Binding Main.Navigator.TestNotify}" TextColor="Transparent" />--> | ||||||
|                 <Frame> |                 <Frame> | ||||||
|                     <Grid> |                     <Grid> | ||||||
|                         <Label Text="Personnages" /> |                         <Label Text="Personnages" /> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez