mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Tests shell
This commit is contained in:
		
							parent
							
								
									8cff9066b2
								
							
						
					
					
						commit
						9b31b53a79
					
				
					 2 changed files with 118 additions and 63 deletions
				
			
		|  | @ -11,6 +11,7 @@ | ||||||
|        Shell.ForegroundColor="{DynamicResource HDRed}" |        Shell.ForegroundColor="{DynamicResource HDRed}" | ||||||
|        Shell.TitleColor="{DynamicResource HDBlack}" |        Shell.TitleColor="{DynamicResource HDBlack}" | ||||||
|        Shell.UnselectedColor="{DynamicResource HDLightGrey}" |        Shell.UnselectedColor="{DynamicResource HDLightGrey}" | ||||||
|  |        FlyoutHeaderBehavior="CollapseOnScroll" | ||||||
|        > |        > | ||||||
|     <Shell.Resources> |     <Shell.Resources> | ||||||
|         <ResourceDictionary> |         <ResourceDictionary> | ||||||
|  | @ -34,6 +35,7 @@ | ||||||
|             <Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" /> |             <Style TargetType="TabBar" BasedOn="{StaticResource BaseStyle}" /> | ||||||
|         </ResourceDictionary> |         </ResourceDictionary> | ||||||
|     </Shell.Resources> |     </Shell.Resources> | ||||||
|  | 
 | ||||||
|     <Shell.FlyoutHeader> |     <Shell.FlyoutHeader> | ||||||
|         <!--<StackLayout>--> |         <!--<StackLayout>--> | ||||||
|         <!--<Label Text="{Binding HeaderTitle}" /> |         <!--<Label Text="{Binding HeaderTitle}" /> | ||||||
|  | @ -41,7 +43,34 @@ | ||||||
|             <Label Text="{Binding CurrentItem.CurrentItem.CurrentItem.Content.BindingContext.Item.Title}" /> |             <Label Text="{Binding CurrentItem.CurrentItem.CurrentItem.Content.BindingContext.Item.Title}" /> | ||||||
|             <Label Text="{Binding Main.CurrentItem.Item.Name}" />--> |             <Label Text="{Binding Main.CurrentItem.Item.Name}" />--> | ||||||
|         <!--<CollectionView IsVisible="{Binding Main.CurrentItem.Filter, Converter={StaticResource NullToFalseConverter}}" ItemsSource="{Binding Main.CurrentItem.Filter.Filters}" >--> |         <!--<CollectionView IsVisible="{Binding Main.CurrentItem.Filter, Converter={StaticResource NullToFalseConverter}}" ItemsSource="{Binding Main.CurrentItem.Filter.Filters}" >--> | ||||||
|         <CollectionView BackgroundColor="Yellow" ItemsSource="{Binding Main.CurrentItem.Filter.Filters}"> |         <ScrollView> | ||||||
|  |             <StackLayout> | ||||||
|  |                 <StackLayout BindableLayout.ItemsSource="{Binding Main.CurrentItem.Filter.Filters}"> | ||||||
|  |                     <BindableLayout.ItemTemplate> | ||||||
|  |                         <DataTemplate> | ||||||
|  |                             <StackLayout Margin="10,5,10,0" Padding="0" Spacing="0"> | ||||||
|  |                                 <Label BindingContext="{Binding}" Text="{Binding Name}" Style="{StaticResource Key=heading3}" /> | ||||||
|  |                                 <Picker HorizontalOptions="FillAndExpand" ItemsSource="{Binding KeyValues, Mode=OneWay}" ItemDisplayBinding="{Binding Value, Mode=OneWay}" SelectedIndex="{Binding Index, Mode=TwoWay}" /> | ||||||
|  |                             </StackLayout> | ||||||
|  |                         </DataTemplate> | ||||||
|  |                     </BindableLayout.ItemTemplate> | ||||||
|  |                 </StackLayout> | ||||||
|  |                 <Button Visual="Material" Text="Accueil" Command="{Binding NavigateToHomeCommand}" /> | ||||||
|  |                 <Button Visual="Material" Text="Personnages" Command="{Binding NavigateToPCCommand}" /> | ||||||
|  |                 <Button Visual="Material" Text="Dés" Command="{Binding NavigateToDicesCommand}" /> | ||||||
|  |                 <Button Visual="Material" Text="Manuel des Règles" Command="{Binding NavigateToItemCommand}" CommandParameter="index_mdr.md"/> | ||||||
|  |                 <Button Visual="Material" Text="Cadre de Campagne" Command="{Binding NavigateToItemCommand}" CommandParameter="index_cdc.md"/> | ||||||
|  |                 <Button Visual="Material" Text="Créatures et Oppositions" Command="{Binding NavigateToItemCommand}" CommandParameter="index_ceo.md"/> | ||||||
|  |                 <Button Visual="Material" Text="Les Cinq Royaumes" Command="{Binding NavigateToItemCommand}" CommandParameter="l5r_index_hd.md"/> | ||||||
|  |                 <Button Visual="Material" Text="Livre des Monstres" Command="{Binding NavigateToItemCommand}" CommandParameter="tome_of_beasts.md"/> | ||||||
|  |                 <Button Visual="Material" Text="Monstrueusement Mignons" Command="{Binding NavigateToItemCommand}" CommandParameter="baby_bestiary.md"/> | ||||||
|  |                 <Button Visual="Material" Text="SRD" Command="{Binding NavigateToItemCommand}" CommandParameter="index_srd.md"/> | ||||||
|  |                 <Button Visual="Material" Text="Favoris" Command="{Binding NavigateToBookmarksCommand}" /> | ||||||
|  |                 <Button Visual="Material" Text="Recherche" Command="{Binding NavigateToDeepSearchCommand}" /> | ||||||
|  |                 <Button Visual="Material" Text="A propos de..." Command="{Binding NavigateToAboutCommand}" /> | ||||||
|  |             </StackLayout> | ||||||
|  |         </ScrollView> | ||||||
|  |         <!--<CollectionView BackgroundColor="Yellow" ItemsSource="{Binding Main.CurrentItem.Filter.Filters}" Header="{Binding}" Footer="{Binding}" EmptyView="{Binding}"> | ||||||
|             <CollectionView.ItemTemplate> |             <CollectionView.ItemTemplate> | ||||||
|                 <DataTemplate> |                 <DataTemplate> | ||||||
|                     <StackLayout Margin="10,5,10,0" Padding="0" Spacing="0"> |                     <StackLayout Margin="10,5,10,0" Padding="0" Spacing="0"> | ||||||
|  | @ -50,9 +79,6 @@ | ||||||
|                     </StackLayout> |                     </StackLayout> | ||||||
|                 </DataTemplate> |                 </DataTemplate> | ||||||
|             </CollectionView.ItemTemplate> |             </CollectionView.ItemTemplate> | ||||||
|             <CollectionView.Header> |  | ||||||
|                 <StackLayout></StackLayout> |  | ||||||
|             </CollectionView.Header> |  | ||||||
|             <CollectionView.HeaderTemplate> |             <CollectionView.HeaderTemplate> | ||||||
|                 <DataTemplate> |                 <DataTemplate> | ||||||
|                     <StackLayout BackgroundColor="Red"> |                     <StackLayout BackgroundColor="Red"> | ||||||
|  | @ -60,27 +86,21 @@ | ||||||
|                     </StackLayout> |                     </StackLayout> | ||||||
|                 </DataTemplate> |                 </DataTemplate> | ||||||
|             </CollectionView.HeaderTemplate> |             </CollectionView.HeaderTemplate> | ||||||
|             <CollectionView.Footer> |  | ||||||
|                 <StackLayout></StackLayout> |  | ||||||
|             </CollectionView.Footer> |  | ||||||
|             <CollectionView.FooterTemplate> |             <CollectionView.FooterTemplate> | ||||||
|                 <DataTemplate> |                 <DataTemplate> | ||||||
|                     <StackLayout BackgroundColor="Blue"> |                     <StackLayout BackgroundColor="Blue"> | ||||||
|                         <Button Text="Accueil Footer" Command="{Binding ShellNavigateCommand}" CommandParameter="//data/item?path=l5r_index_hd.md"/> |                         <Button Visual="Material" Text="Accueil" Command="{Binding ShellNavigateCommand}" CommandParameter="index.md"/> | ||||||
|                     </StackLayout> |                     </StackLayout> | ||||||
|                 </DataTemplate> |                 </DataTemplate> | ||||||
|             </CollectionView.FooterTemplate> |             </CollectionView.FooterTemplate> | ||||||
|             <CollectionView.EmptyView> |  | ||||||
|                 <StackLayout></StackLayout> |  | ||||||
|             </CollectionView.EmptyView> |  | ||||||
|             <CollectionView.EmptyViewTemplate> |             <CollectionView.EmptyViewTemplate> | ||||||
|                 <DataTemplate> |                 <DataTemplate> | ||||||
|                     <StackLayout BackgroundColor="Green"> |                     <StackLayout BackgroundColor="Green"> | ||||||
|                         <Button Text="Accueil Empty" Command="{Binding ShellNavigateCommand}" CommandParameter="//data/item?path=l5r_index_hd.md"/> |                         <Button Text="Accueil Empty" Command="{Binding Main.Navigator.NavigateToLinkCommand}" CommandParameter="l5r_index_hd.md"/> | ||||||
|                     </StackLayout> |                     </StackLayout> | ||||||
|                 </DataTemplate> |                 </DataTemplate> | ||||||
|             </CollectionView.EmptyViewTemplate> |             </CollectionView.EmptyViewTemplate> | ||||||
|         </CollectionView> |         </CollectionView>--> | ||||||
|         <!--<ListView BackgroundColor="Red" IsVisible="{Binding Main.CurrentItem.Filter, Converter={StaticResource NullToFalseConverter}}"  SelectionMode="None" ItemsSource="{Binding Main.CurrentItem.Filter.Filters}" HasUnevenRows="True" RowHeight="-1" SeparatorVisibility="None" IsPullToRefreshEnabled="False" HorizontalOptions="FillAndExpand" VerticalOptions="Start"> |         <!--<ListView BackgroundColor="Red" IsVisible="{Binding Main.CurrentItem.Filter, Converter={StaticResource NullToFalseConverter}}"  SelectionMode="None" ItemsSource="{Binding Main.CurrentItem.Filter.Filters}" HasUnevenRows="True" RowHeight="-1" SeparatorVisibility="None" IsPullToRefreshEnabled="False" HorizontalOptions="FillAndExpand" VerticalOptions="Start"> | ||||||
|                 <ListView.ItemTemplate> |                 <ListView.ItemTemplate> | ||||||
|                     <DataTemplate> |                     <DataTemplate> | ||||||
|  | @ -101,14 +121,13 @@ | ||||||
|     <FlyoutItem Title="Accueil"> |     <FlyoutItem Title="Accueil"> | ||||||
|         <ShellContent Title="Accueil"  ContentTemplate="{DataTemplate local:MainPage}" /> |         <ShellContent Title="Accueil"  ContentTemplate="{DataTemplate local:MainPage}" /> | ||||||
|     </FlyoutItem> |     </FlyoutItem> | ||||||
|     <FlyoutItem Title="Personnages" FlyoutIcon="battle_axe.png"> |     <!--<FlyoutItem Title="Personnages" FlyoutIcon="battle_axe.png"> | ||||||
|         <ShellContent Title="Personnages"  ContentTemplate="{DataTemplate pc:PlayerCharacterEditorPage}" /> |         <ShellContent Title="Personnages"  ContentTemplate="{DataTemplate pc:PlayerCharacterEditorPage}" /> | ||||||
|     </FlyoutItem> |     </FlyoutItem> | ||||||
|     <FlyoutItem Title="Dés" FlyoutIcon="d20.png"> |     <FlyoutItem Title="Dés" FlyoutIcon="d20.png"> | ||||||
|         <ShellContent Title="Dés"  ContentTemplate="{DataTemplate local:DicesPage}" /> |         <ShellContent Title="Dés"  ContentTemplate="{DataTemplate local:DicesPage}" /> | ||||||
|     </FlyoutItem> |     </FlyoutItem> | ||||||
|     <FlyoutItem Title="Bibliothèque" FlyoutIcon="spell_book.png"> |     <FlyoutItem Title="Bibliothèque" FlyoutIcon="spell_book.png"> | ||||||
|         <!--<ShellContent Title="Bibliothèque" Icon="spell_book.png" ContentTemplate="{DataTemplate library:ItemPage}" />--> |  | ||||||
|         <ShellContent Title="Bibliothèque" Icon="spell_book.png"> |         <ShellContent Title="Bibliothèque" Icon="spell_book.png"> | ||||||
|             <ShellContent.ContentTemplate> |             <ShellContent.ContentTemplate> | ||||||
|                 <DataTemplate> |                 <DataTemplate> | ||||||
|  | @ -122,33 +141,6 @@ | ||||||
|         </ShellContent> |         </ShellContent> | ||||||
| 
 | 
 | ||||||
|     </FlyoutItem> |     </FlyoutItem> | ||||||
|     <!--<FlyoutItem Title="Héros & Dragons"> |  | ||||||
|         <ShellContent Title="Héros & Dragons" ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="Manuel des règles"> |  | ||||||
|         <ShellContent Title="Manuel des règles" ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="Cadre de campagne"> |  | ||||||
|         <ShellContent Title="Cadre de campagne" ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="Créatures et oppositions"> |  | ||||||
|         <ShellContent Title="Créatures et oppositions" ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="Les Cinq Royaumes" Route="data"> |  | ||||||
|         <ShellContent Title="Les Cinq Royaumes" Route="l5r_index_hd.md" ContentTemplate="{DataTemplate library:ItemPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="Livre des monstres"> |  | ||||||
|         <ShellContent Title="Livre des monstres" ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="Monstrueusement Mignons"> |  | ||||||
|         <ShellContent Title="Monstrueusement Mignons" ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="Joan of Arc"> |  | ||||||
|         <ShellContent Title="Joan of Arc"  ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem> |  | ||||||
|     <FlyoutItem Title="SRD"> |  | ||||||
|         <ShellContent Title="SRD"  ContentTemplate="{DataTemplate library:ItemDetailPage}" /> |  | ||||||
|     </FlyoutItem>--> |  | ||||||
|     <FlyoutItem Title="Manuel des Règles"> |     <FlyoutItem Title="Manuel des Règles"> | ||||||
|         <ShellContent> |         <ShellContent> | ||||||
|             <ShellContent.ContentTemplate> |             <ShellContent.ContentTemplate> | ||||||
|  | @ -246,24 +238,8 @@ | ||||||
|     <FlyoutItem Title="Recherche"> |     <FlyoutItem Title="Recherche"> | ||||||
|         <ShellContent Title="Recherche"  ContentTemplate="{DataTemplate library:DeepSearchPage}"  FlyoutIcon="crystal_ball.png" /> |         <ShellContent Title="Recherche"  ContentTemplate="{DataTemplate library:DeepSearchPage}"  FlyoutIcon="crystal_ball.png" /> | ||||||
|     </FlyoutItem> |     </FlyoutItem> | ||||||
|     <!--Command="{Binding ShellNavigateCommand}" |  | ||||||
|               CommandParameter="//data/item?path=l5r_index_hd.md" |  | ||||||
|               />--> |  | ||||||
|     <FlyoutItem Title="A propos de..." FlyoutIcon="wooden_sign.png"> |     <FlyoutItem Title="A propos de..." FlyoutIcon="wooden_sign.png"> | ||||||
|         <ShellContent Title="A propos de..."  ContentTemplate="{DataTemplate local:AboutPage}" /> |         <ShellContent Title="A propos de..."  ContentTemplate="{DataTemplate local:AboutPage}" /> | ||||||
|     </FlyoutItem> |     </FlyoutItem>--> | ||||||
|     <!--<ShellItem Text="Test"> |  | ||||||
|          |  | ||||||
|     </ShellItem>--> |  | ||||||
|     <!--Command="{Binding ShellNavigateCommand}" |  | ||||||
|               CommandParameter="//data/item?path=l5r_index_hd.md" |  | ||||||
|               />--> |  | ||||||
|     <!--<ShellItem> |  | ||||||
|         <ShellSection> |  | ||||||
|             <ShellContent> |  | ||||||
|                 <local:MainPage/> |  | ||||||
|             </ShellContent> |  | ||||||
|         </ShellSection> |  | ||||||
|     </ShellItem>--> |  | ||||||
| 
 | 
 | ||||||
| </Shell> | </Shell> | ||||||
|  | @ -30,16 +30,95 @@ namespace AideDeJeu.Views | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public ICommand ShellNavigateCommand |         public ICommand NavigateToItemCommand | ||||||
|         { |         { | ||||||
|             get |             get | ||||||
|             { |             { | ||||||
|                 return new Command<string>(async (path) => await ExecuteShellNavigateCommandAsync(path)); |                 return new Command<string>(async (path) => await ExecuteNavigateToItemCommandAsync(path)); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         private async Task ExecuteShellNavigateCommandAsync(string path) |         private async Task ExecuteNavigateToItemCommandAsync(string path) | ||||||
|         { |         { | ||||||
|             await Shell.Current.GoToAsync(path); |             await Navigation.PushAsync(new Library.ItemPage(path), true); | ||||||
|  |             this.FlyoutIsPresented = false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public ICommand NavigateToHomeCommand | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return new Command(async() => await ExecuteNavigateToHomeCommandAsync()); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         private async Task ExecuteNavigateToHomeCommandAsync() | ||||||
|  |         { | ||||||
|  |             await Navigation.PushAsync(new MainPage(), true); | ||||||
|  |             this.FlyoutIsPresented = false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public ICommand NavigateToPCCommand | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return new Command(async () => await ExecuteNavigateToPCCommandAsync()); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         private async Task ExecuteNavigateToPCCommandAsync() | ||||||
|  |         { | ||||||
|  |             await Navigation.PushAsync(new PlayerCharacter.PlayerCharacterEditorPage(), true); | ||||||
|  |             this.FlyoutIsPresented = false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public ICommand NavigateToDicesCommand | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return new Command(async () => await ExecuteNavigateToDicesCommandAsync()); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         private async Task ExecuteNavigateToDicesCommandAsync() | ||||||
|  |         { | ||||||
|  |             await Navigation.PushAsync(new DicesPage(), true); | ||||||
|  |             this.FlyoutIsPresented = false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public ICommand NavigateToBookmarksCommand | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return new Command(async () => await ExecuteNavigateToBookmarksCommandAsync()); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         private async Task ExecuteNavigateToBookmarksCommandAsync() | ||||||
|  |         { | ||||||
|  |             await Navigation.PushAsync(new Library.BookmarksPage(), true); | ||||||
|  |             this.FlyoutIsPresented = false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public ICommand NavigateToDeepSearchCommand | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return new Command(async () => await ExecuteNavigateToDeepSearchCommandAsync()); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         private async Task ExecuteNavigateToDeepSearchCommandAsync() | ||||||
|  |         { | ||||||
|  |             await Navigation.PushAsync(new Library.DeepSearchPage(), true); | ||||||
|  |             this.FlyoutIsPresented = false; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public ICommand NavigateToAboutCommand | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return new Command(async () => await ExecuteNavigateToAboutCommandAsync()); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |         private async Task ExecuteNavigateToAboutCommandAsync() | ||||||
|  |         { | ||||||
|  |             await Navigation.PushAsync(new AboutPage(), true); | ||||||
|  |             this.FlyoutIsPresented = false; | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         private string _HeaderTitle = string.Empty; |         private string _HeaderTitle = string.Empty; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez