mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	CarousselPage
This commit is contained in:
		
							parent
							
								
									6bb192145a
								
							
						
					
					
						commit
						efc1923b25
					
				
					 2 changed files with 272 additions and 175 deletions
				
			
		|  | @ -1,5 +1,5 @@ | |||
| <?xml version="1.0" encoding="utf-8" ?> | ||||
| <TabbedPage  | ||||
| <CarouselPage  | ||||
|         xmlns="http://xamarin.com/schemas/2014/forms" | ||||
|         xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||||
|         x:Class="AideDeJeu.Views.PlayerCharacter.PlayerCharacterEditorPage" | ||||
|  | @ -11,10 +11,10 @@ | |||
|         xmlns:pickers="clr-namespace:AideDeJeu.Views.Pickers" | ||||
|         x:Name="This" | ||||
|         Title="Création de personnage" | ||||
|         SelectedTabColor="{StaticResource HDRed}" | ||||
|         UnselectedTabColor="{StaticResource HDMidGrey}" | ||||
|         android:TabbedPage.IsSwipePagingEnabled="True"> | ||||
|     <TabbedPage.Resources> | ||||
|     <!--SelectedTabColor="{StaticResource HDRed}" | ||||
|         UnselectedTabColor="{StaticResource HDMidGrey}"--> | ||||
|     <CarouselPage.Resources> | ||||
|         <StyleSheet> | ||||
|             <![CDATA[ | ||||
|             imagebutton { | ||||
|  | @ -52,12 +52,21 @@ | |||
|             <tools:MonsterMarkdownTheme x:Key="MonsterMarkdownTheme" /> | ||||
|             <tools:NullToFalseConverter x:Key="NullToFalseConverter" /> | ||||
|         </ResourceDictionary> | ||||
|     </TabbedPage.Resources> | ||||
|     <TabbedPage.ToolbarItems> | ||||
|     </CarouselPage.Resources> | ||||
|     <CarouselPage.ToolbarItems> | ||||
|         <ToolbarItem Text="Ouvrir en PDF avec..." Command="{Binding GenerateAndOpenPdfCommand}" Order="Secondary" /> | ||||
|     </TabbedPage.ToolbarItems> | ||||
|     <ContentPage Title="Race"> | ||||
|         <ScrollView Orientation="Vertical"> | ||||
|     </CarouselPage.ToolbarItems> | ||||
|     <ContentPage x:Name="Race" Title="Race"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|             </Grid.ColumnDefinitions> | ||||
|             <Grid.RowDefinitions> | ||||
|                 <RowDefinition Height="*" /> | ||||
|                 <RowDefinition Height="auto" /> | ||||
|             </Grid.RowDefinitions> | ||||
|             <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}" /> | ||||
|                     <!--<Picker Title="Race" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Races.IsSuccessfullyCompleted}" ItemsSource="{Binding Races.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding RaceSelectedIndex, Mode=TwoWay}" />--> | ||||
|  | @ -102,9 +111,20 @@ | |||
|                     <!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedRace.Markdown}" />--> | ||||
|                 </StackLayout> | ||||
|             </ScrollView> | ||||
|             <Button Grid.Column="1" Grid.Row="1" Text="Classe" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Class}"/> | ||||
|         </Grid> | ||||
|     </ContentPage> | ||||
|     <ContentPage Title="Classe"> | ||||
|         <ScrollView Orientation="Vertical"> | ||||
|     <ContentPage x:Name="Class" Title="Classe"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|             </Grid.ColumnDefinitions> | ||||
|             <Grid.RowDefinitions> | ||||
|                 <RowDefinition Height="*" /> | ||||
|                 <RowDefinition Height="auto" /> | ||||
|             </Grid.RowDefinitions> | ||||
|             <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|                 <StackLayout> | ||||
|                     <pickers:ItemPickerView BindingContext="{Binding}" Title="Classe" ItemsSource="{Binding Classes.Result}" 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}" />--> | ||||
|  | @ -140,9 +160,21 @@ | |||
|                     <!--<mdview:MarkdownView Theme="{StaticResource MonsterMarkdownTheme}" Markdown="{Binding SelectedPlayerCharacter.Class.Markdown}" />--> | ||||
|                 </StackLayout> | ||||
|             </ScrollView> | ||||
|             <Button Grid.Column="0" Grid.Row="1" Text="Race" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Race}"/> | ||||
|             <Button Grid.Column="1" Grid.Row="1" Text="Historique" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Background}"/> | ||||
|         </Grid> | ||||
|     </ContentPage> | ||||
|     <ContentPage Title="Historique"> | ||||
|         <ScrollView Orientation="Vertical"> | ||||
|     <ContentPage x:Name="Background" Title="Historique"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|             </Grid.ColumnDefinitions> | ||||
|             <Grid.RowDefinitions> | ||||
|                 <RowDefinition Height="*" /> | ||||
|                 <RowDefinition Height="auto" /> | ||||
|             </Grid.RowDefinitions> | ||||
|             <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|                 <StackLayout> | ||||
| 
 | ||||
|                     <!-- DEBUG --> | ||||
|  | @ -199,9 +231,21 @@ | |||
| 
 | ||||
|                 </StackLayout> | ||||
|             </ScrollView> | ||||
|             <Button Grid.Column="0" Grid.Row="1" Text="Classe" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Class}"/> | ||||
|             <Button Grid.Column="1" Grid.Row="1" Text="Caractéristiques" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Abilities}"/> | ||||
|         </Grid> | ||||
|     </ContentPage> | ||||
|     <ContentPage Title="Caractéristiques"> | ||||
|         <ScrollView Orientation="Vertical"> | ||||
|     <ContentPage x:Name="Abilities" Title="Caractéristiques"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|             </Grid.ColumnDefinitions> | ||||
|             <Grid.RowDefinitions> | ||||
|                 <RowDefinition Height="*" /> | ||||
|                 <RowDefinition Height="auto" /> | ||||
|             </Grid.RowDefinitions> | ||||
|             <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|                 <StackLayout> | ||||
|                     <Frame BorderColor="Black" Padding="2" Margin="10"> | ||||
|                         <ImageButton Source="rolling_dice_cup.png" Command="{Binding RollDicesCommand}" /> | ||||
|  | @ -262,15 +306,39 @@ | |||
|                 <pickers:StringPickerView BindingContext="{Binding}" Title="Charisme" ItemsSource="{Binding Abilities}" SelectedItem="{Binding SelectedPlayerCharacter.Abilities.Charisma.BaseValue, Mode=TwoWay}" />--> | ||||
|                 </StackLayout> | ||||
|             </ScrollView> | ||||
|             <Button Grid.Column="0" Grid.Row="1" Text="Historique" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Background}"/> | ||||
|             <Button Grid.Column="1" Grid.Row="1" Text="Équipement" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Equipment}"/> | ||||
|         </Grid> | ||||
|     </ContentPage> | ||||
|     <ContentPage Title="Equipement"> | ||||
|         <ScrollView Orientation="Vertical"> | ||||
|     <ContentPage x:Name="Equipment" Title="Équipement"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|             </Grid.ColumnDefinitions> | ||||
|             <Grid.RowDefinitions> | ||||
|                 <RowDefinition Height="*" /> | ||||
|                 <RowDefinition Height="auto" /> | ||||
|             </Grid.RowDefinitions> | ||||
|             <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|                 <StackLayout> | ||||
|                 </StackLayout> | ||||
|             </ScrollView> | ||||
|             <Button Grid.Column="0" Grid.Row="1" Text="Caractéristiques" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Abilities}"/> | ||||
|             <Button Grid.Column="1" Grid.Row="1" Text="Finalisation" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Finalize}"/> | ||||
|         </Grid> | ||||
|     </ContentPage> | ||||
|     <ContentPage Title="Finalisation"> | ||||
|         <ScrollView Orientation="Vertical"> | ||||
|     <ContentPage x:Name="Finalize" Title="Finalisation"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|             </Grid.ColumnDefinitions> | ||||
|             <Grid.RowDefinitions> | ||||
|                 <RowDefinition Height="*" /> | ||||
|                 <RowDefinition Height="auto" /> | ||||
|             </Grid.RowDefinitions> | ||||
|             <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|                 <StackLayout> | ||||
|                     <Entry Placeholder="Nom" Text="{Binding Name}" Keyboard="Text" /> | ||||
|                     <!--<Picker Title="Alignement" HorizontalOptions="FillAndExpand" IsEnabled="{Binding Alignments.IsSuccessfullyCompleted}" ItemsSource="{Binding Alignments.Result}" ItemDisplayBinding="{Binding Name}" SelectedIndex="{Binding AlignmentSelectedIndex, Mode=TwoWay}" />--> | ||||
|  | @ -280,12 +348,27 @@ | |||
|                     <Picker Title="Niveau" HorizontalOptions="FillAndExpand" ItemsSource="{Binding Levels}" ItemDisplayBinding="{Binding StringFormat='Niveau : {0}'}" /> | ||||
|                 </StackLayout> | ||||
|             </ScrollView> | ||||
|             <Button Grid.Column="0" Grid.Row="1" Text="Équipement" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Equipment}"/> | ||||
|             <Button Grid.Column="1" Grid.Row="1" Text="Résumé" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Resume}"/> | ||||
|         </Grid> | ||||
|     </ContentPage> | ||||
|     <ContentPage Title="Résumé"> | ||||
|         <ScrollView Orientation="Vertical"> | ||||
|     <ContentPage x:Name="Resume" Title="Résumé"> | ||||
|         <Grid> | ||||
|             <Grid.ColumnDefinitions> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|                 <ColumnDefinition Width="*" /> | ||||
|             </Grid.ColumnDefinitions> | ||||
|             <Grid.RowDefinitions> | ||||
|                 <RowDefinition Height="*" /> | ||||
|                 <RowDefinition Height="auto" /> | ||||
|             </Grid.RowDefinitions> | ||||
| 
 | ||||
|             <ScrollView Grid.ColumnSpan="2" Orientation="Vertical"> | ||||
|                 <StackLayout> | ||||
|                 </StackLayout> | ||||
|             </ScrollView> | ||||
|             <Button Grid.Column="0" Grid.Row="1" Text="Finalisation" Command="{Binding ChangePageCommand, Source={x:Reference This}}" CommandParameter="{x:Reference Finalize}"/> | ||||
|         </Grid> | ||||
|     </ContentPage> | ||||
|     <!--<StackLayout Orientation="Vertical"> | ||||
|         <TableView Margin="10,0"> | ||||
|  | @ -327,4 +410,4 @@ | |||
|             </TableRoot> | ||||
|         </TableView> | ||||
|     </StackLayout>--> | ||||
| </TabbedPage> | ||||
| </CarouselPage> | ||||
|  | @ -2,6 +2,7 @@ | |||
| using AideDeJeu.ViewModels.PlayerCharacter; | ||||
| using System; | ||||
| using System.Collections.Generic; | ||||
| using System.Diagnostics; | ||||
| using System.Linq; | ||||
| using System.Text; | ||||
| using System.Threading.Tasks; | ||||
|  | @ -12,7 +13,7 @@ using Xamarin.Forms.Xaml; | |||
| namespace AideDeJeu.Views.PlayerCharacter | ||||
| { | ||||
|     [XamlCompilation(XamlCompilationOptions.Compile)] | ||||
|     public partial class PlayerCharacterEditorPage : TabbedPage | ||||
|     public partial class PlayerCharacterEditorPage : CarouselPage | ||||
|     { | ||||
|         public PlayerCharacterEditorPage() | ||||
|         { | ||||
|  | @ -21,5 +22,18 @@ namespace AideDeJeu.Views.PlayerCharacter | |||
|             InitializeComponent(); | ||||
| 
 | ||||
|         } | ||||
| 
 | ||||
|         public Command ChangePageCommand | ||||
|         { | ||||
|             get | ||||
|             { | ||||
|                 return new Command<object>(ExecuteChangePageCommand); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|         public void ExecuteChangePageCommand(object param) | ||||
|         { | ||||
|             This.CurrentPage = param as ContentPage; | ||||
|         } | ||||
|     } | ||||
| } | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez