mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Behavior
This commit is contained in:
		
							parent
							
								
									8715e97c12
								
							
						
					
					
						commit
						ba64d02434
					
				
					 2 changed files with 24 additions and 2 deletions
				
			
		|  | @ -38,7 +38,7 @@ namespace AideDeJeu.ViewModels | ||||||
|             set |             set | ||||||
|             { |             { | ||||||
|                 SetProperty(ref _BookmarkCollectionIndex, value); |                 SetProperty(ref _BookmarkCollectionIndex, value); | ||||||
|                 LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); |                 //LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         private ObservableCollection<Item> _BookmarkCollection = new ObservableCollection<Item>(); |         private ObservableCollection<Item> _BookmarkCollection = new ObservableCollection<Item>(); | ||||||
|  | @ -54,6 +54,23 @@ namespace AideDeJeu.ViewModels | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  |         private ICommand _SelectedIndexChangedCommand = null; | ||||||
|  |         public ICommand SelectedIndexChangedCommand | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return _SelectedIndexChangedCommand ?? (_SelectedIndexChangedCommand = new Command(async() => await ExecuteSelectedIndexChangedCommand())); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         private async Task ExecuteSelectedIndexChangedCommand() | ||||||
|  |         { | ||||||
|  |             if (BookmarkCollectionIndex >= 0 && BookmarkCollectionIndex < BookmarkCollectionNames.Count) | ||||||
|  |             { | ||||||
|  |                 //BookmarkCollectionIndex = index; | ||||||
|  |                 await LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); | ||||||
|  |             } | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         private ICommand _GotoItemCommand = null; |         private ICommand _GotoItemCommand = null; | ||||||
|         public ICommand GotoItemCommand |         public ICommand GotoItemCommand | ||||||
|  |  | ||||||
|  | @ -10,6 +10,7 @@ | ||||||
|         <ResourceDictionary> |         <ResourceDictionary> | ||||||
|             <tools:IntToBooleanConverter x:Key="IntToBooleanConverter" NonZeroValue="False" NullOrZeroValue="True" /> |             <tools:IntToBooleanConverter x:Key="IntToBooleanConverter" NonZeroValue="False" NullOrZeroValue="True" /> | ||||||
|             <tools:HeaderLevelToStyleConverter x:Key="HeaderLevelToStyleConverter" /> |             <tools:HeaderLevelToStyleConverter x:Key="HeaderLevelToStyleConverter" /> | ||||||
|  |             <tools:EventToCommandBehavior x:Key="EventToCommandBehavior" /> | ||||||
|         </ResourceDictionary> |         </ResourceDictionary> | ||||||
|     </ContentPage.Resources> |     </ContentPage.Resources> | ||||||
|     <ContentPage.ToolbarItems> |     <ContentPage.ToolbarItems> | ||||||
|  | @ -25,7 +26,11 @@ | ||||||
|                 <RowDefinition Height="*" /> |                 <RowDefinition Height="*" /> | ||||||
|             </Grid.RowDefinitions> |             </Grid.RowDefinitions> | ||||||
| 
 | 
 | ||||||
|             <Picker Grid.Column="0" Grid.Row="0" Style="{StaticResource heading1}" HorizontalOptions="Fill" ItemsSource="{Binding BookmarkCollectionNames, Mode=OneWay}" ItemDisplayBinding="{Binding Mode=OneWay}" SelectedIndex="{Binding BookmarkCollectionIndex, Mode=TwoWay}" /> |             <Picker x:Name="BookmarkCollectionPicker" Grid.Column="0" Grid.Row="0" Style="{StaticResource heading1}" HorizontalOptions="Fill" ItemsSource="{Binding BookmarkCollectionNames, Mode=OneWay}" ItemDisplayBinding="{Binding Mode=OneWay}" SelectedIndex="{Binding BookmarkCollectionIndex, Mode=TwoWay}"> | ||||||
|  |                 <Picker.Behaviors> | ||||||
|  |                     <tools:EventToCommandBehavior EventName="SelectedIndexChanged" Command="{Binding BindingContext.SelectedIndexChangedCommand, Source={x:Reference This}}" /> | ||||||
|  |                 </Picker.Behaviors> | ||||||
|  |             </Picker> | ||||||
| 
 | 
 | ||||||
|             <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalOptions="Center" VerticalOptions="Center" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Margin="15,0,15,0" Style="{StaticResource heading3}" Text="Cette liste est vide, ajoutez des éléments à partir de la bibliothèque !" IsVisible="{Binding BookmarkCollection.Count, Converter={StaticResource IntToBooleanConverter}}" /> |             <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalOptions="Center" VerticalOptions="Center" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Margin="15,0,15,0" Style="{StaticResource heading3}" Text="Cette liste est vide, ajoutez des éléments à partir de la bibliothèque !" IsVisible="{Binding BookmarkCollection.Count, Converter={StaticResource IntToBooleanConverter}}" /> | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez