IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Windows Presentation Foundation Discussion :

[XAML] Problème tabcontrol dimensionnement [Débutant]


Sujet :

Windows Presentation Foundation

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Profil pro
    Débutant
    Inscrit en
    Février 2007
    Messages
    134
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Débutant
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Février 2007
    Messages : 134
    Par défaut [XAML] Problème tabcontrol dimensionnement
    Bonjour à tous, je rencontre actuellement un problème avec un tabcontrol dans avalonia. En effet, le premier tabitem se présente bien comme souhaité mais lors du passage au tabitem 2 , le tab control se redimensionne. Je comprend bien que le contenu du tabitem 2 est plus petit que le tabitem1.

    Par contre je ne parviens pas à fixer le tabcontrol de manière à ce que le tabitem 2 s'adapte à sont parent et pas l'inverse.

    merci pour votre aide

    Voici le code:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    <UserControl xmlns="https://github.com/avaloniaui"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                 xmlns:vm="using:EBooKLab.ViewModels.Pages"
    			 mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="600"
                 x:Class="EBooKLab.Views.Pages.A_ProposPageView"
    			 x:DataType="vm:A_ProposPageViewModel"
    			 FontSize="18">
     
    	<Design.DataContext>
    		<vm:A_ProposPageViewModel/>
    	</Design.DataContext>
     
    	<Grid VerticalAlignment="Center" HorizontalAlignment="Center">
     
    		<Grid.ColumnDefinitions>
    			<ColumnDefinition Width="Auto"/>
    			<ColumnDefinition Width="*"/>
    		</Grid.ColumnDefinitions>
     
    		<Image
    			Grid.Column="0"
    			Source="/Assets/Logo01.jpg"
    			Stretch="Uniform"
    			VerticalAlignment="Center" HorizontalAlignment="Center"
    			Width="125"/>
     
    			<TabControl  
    				Grid.Column="1"
    				VerticalAlignment="Top"  Margin="5">
     
    			<TabItem Header="A propos de" >
     
    				<StackPanel Orientation="Vertical"
    					HorizontalAlignment="Left"
    					Spacing="10"
    					Margin="5,15,5,5">
     
    					<StackPanel
    						Orientation="Horizontal"
    						HorizontalAlignment="Left"
    						Spacing="25">				
    						<Image Source="/Assets/AppIcon.ico" Height="32"/>
    						<TextBlock Text="{Binding NomCourt}" VerticalAlignment="Center" FontSize="24"/>
    					</StackPanel>
     
    					<Separator/>
     
    					<Grid Margin="5">
    						<Grid.ColumnDefinitions>
    							<ColumnDefinition Width="Auto"/>
    							<ColumnDefinition Width="*"/>
    						</Grid.ColumnDefinitions>
    						<Grid.RowDefinitions>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    							<RowDefinition Height="*"/>
    						</Grid.RowDefinitions>
     
    						<TextBlock 
    							Grid.Column="0" Grid.Row="0"
    							Text="Nom court"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="0"
    							Text="{Binding NomCourt}"
    							Margin="5"/>
     
    						<TextBlock
    							Grid.Column="0" Grid.Row="1"
    							Text="Nom long"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="1"
    							Text="{Binding NomLong}"
    							Margin="5"/>
     
    						<TextBlock
    							Grid.Column="0" Grid.Row="2"
    							Text="Description"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="2"
    							Text="{Binding Desciption}"
    							Margin="5"/>
     
    						<Separator Grid.Row="3" Grid.ColumnSpan="2" Margin="5"/>
     
    						<TextBlock
    							Grid.Column="0" Grid.Row="4"
    							Text="Version"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="4"
    							Text="{Binding Version}"
    							Margin="5"/>
     
    						<TextBlock
    							Grid.Column="0" Grid.Row="5"
    							Text="Developper"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="5"
    							Text="{Binding Developper}"
    							Margin="5"/>
     
    						<TextBlock
    							Grid.Column="0" Grid.Row="6"
    							Text="Date de début"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="6"
    							Text="{Binding DateDebut}"
    							Margin="5"/>
     
    						<TextBlock
    							Grid.Column="0" Grid.Row="7"
    							Text="Copyright"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="7"
    							Text="{Binding CopyRigth}"
    							Margin="5"/>
     
    						<Separator Grid.Row="8" Grid.ColumnSpan="2" Margin="5"/>
     
    						<TextBlock
    							Grid.Column="0" Grid.Row="9"
    							Text="Dépôt"
    							Margin="5"/>
    						<TextBlock
    							Grid.Column="1" Grid.Row="9"
    							Text="{Binding Repository}"
    							Margin="5"
    							Foreground="LightBlue"
    						    TextDecorations="Underline"/>
    					</Grid>
     
    				</StackPanel>
     
    			</TabItem>
     
    			<TabItem Header="Historique" >
     
    				<StackPanel>
     
    				<ScrollViewer VerticalScrollBarVisibility="Auto" >
    					<TextBlock
    						Text="{Binding History}"
    						TextWrapping="Wrap"
    						Margin="5,15,5,5" />
    				</ScrollViewer>
    				</StackPanel>
    			</TabItem>
     
    		</TabControl>
     
    	</Grid>
     
    </UserControl>

  2. #2
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 530
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 530
    Par défaut
    Avez-vous un dépôt Github ou GitLab avec un projet qui reproduit le problème, SVP ?

  3. #3
    Membre confirmé
    Profil pro
    Débutant
    Inscrit en
    Février 2007
    Messages
    134
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Débutant
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Février 2007
    Messages : 134
    Par défaut
    Bonjour, je viens d'en créer un. Il est disponible à l'adresse suivante : https://github.com/agparchitecture/A...estApplication.

    Le problème survient dans la partie à propos.

    Merci de votre aide.

  4. #4
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 530
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 530
    Par défaut
    Je suis très très rouillé en XAML (au moins 10 ans que j'y touche plus).
    Mais j'ai l'impression que l'application fait ce que vous lui demandé, cf. ligne 15 de votre .axaml.

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
    Si vous ne voulez pas que le tabControl "se balade" :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <Grid VerticalAlignment="Top" HorizontalAlignment="Left">

  5. #5
    Membre confirmé
    Profil pro
    Débutant
    Inscrit en
    Février 2007
    Messages
    134
    Détails du profil
    Informations personnelles :
    Âge : 46
    Localisation : Belgique

    Informations professionnelles :
    Activité : Débutant
    Secteur : Administration - Collectivité locale

    Informations forums :
    Inscription : Février 2007
    Messages : 134
    Par défaut
    Merci Bacelar d'avoir regardé.

    Effectivement l'application centre bien l'élement comme tu le fait remarqué. Et je souhaite effectivement que celà reste centrée.

    En fait le problème est que je ne parviens pas à définir une dimension fixe et automatique de la grille en fonction de sont contenu.

  6. #6
    Expert confirmé
    Homme Profil pro
    Développeur informatique
    Inscrit en
    Février 2005
    Messages
    5 530
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 53
    Localisation : France, Val de Marne (Île de France)

    Informations professionnelles :
    Activité : Développeur informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Février 2005
    Messages : 5 530
    Par défaut
    dimension fixe et automatique
    C'est antinomique, non ?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. WPF, XAML, TabControl Couleur différents
    Par sou_dj dans le forum Windows Presentation Foundation
    Réponses: 2
    Dernier message: 02/06/2011, 12h35
  2. WPF, XAML, Un broblème avec mon Style TabControl
    Par sou_dj dans le forum Windows Presentation Foundation
    Réponses: 4
    Dernier message: 02/06/2011, 10h38
  3. [débutant]TabControl dans XAML
    Par Chakalaka dans le forum Windows Presentation Foundation
    Réponses: 6
    Dernier message: 21/02/2010, 18h17
  4. Dimensionnement du serveur ?
    Par foste dans le forum Access
    Réponses: 5
    Dernier message: 21/05/2003, 13h22
  5. Re-dimensionnement automatique de composants
    Par ludo_7 dans le forum C++Builder
    Réponses: 10
    Dernier message: 16/05/2002, 16h35

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo