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

Silverlight Discussion :

xaml non valide


Sujet :

Silverlight

  1. #1
    Membre du Club
    Étudiant
    Inscrit en
    Février 2009
    Messages
    55
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2009
    Messages : 55
    Points : 49
    Points
    49
    Par défaut xaml non valide
    Bonjour
    au débogage d'une silverlight business application que je viens de créer (j'ai rien modifié) une exception dans la mainPage.xaml
    Exception a été levé dans "controleTemplate" : XAML non valide
    où pourrait être le problème ?
    je travail avec visual studio 2010, silverlight 4

    Merci

  2. #2
    Membre habitué
    Profil pro
    Consultant informatique
    Inscrit en
    Septembre 2009
    Messages
    99
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations professionnelles :
    Activité : Consultant informatique

    Informations forums :
    Inscription : Septembre 2009
    Messages : 99
    Points : 152
    Points
    152
    Par défaut
    Citation Envoyé par technosmile Voir le message
    " exception a été levé dans "controleTemplate" : XAML non valide
    A vu de nez, essaye de remplacer "controleTemplate" par "ControlTemplate".
    Le mieux serait de nous montrer ton code XAML sinon ça ne va pas être facile d'aider
    Cette réponse vous a aidé ?
    Problème résolu ?

  3. #3
    Membre du Club
    Étudiant
    Inscrit en
    Février 2009
    Messages
    55
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2009
    Messages : 55
    Points : 49
    Points
    49
    Par défaut
    voilà la MainPage.xaml
    Code xml : 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
     
    <UserControl 
      x:Class="my_sl_businnes_app.MainPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation" 
      xmlns:uriMapper="clr-namespace:System.Windows.Navigation;assembly=System.Windows.Controls.Navigation"
      xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480">
     
      <Grid x:Name="LayoutRoot" Style="{StaticResource LayoutRootGridStyle}">
     
        <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}">
                <navigation:Frame x:Name="ContentFrame" Style="{StaticResource ContentFrameStyle}" 
                                  Source="/Home" Navigated="ContentFrame_Navigated" NavigationFailed="ContentFrame_NavigationFailed">
                    <navigation:Frame.UriMapper>
                      <uriMapper:UriMapper>
                        <uriMapper:UriMapping Uri="" MappedUri="/Views/Home.xaml"/>
                        <uriMapper:UriMapping Uri="/{pageName}" MappedUri="/Views/{pageName}.xaml"/>
                      </uriMapper:UriMapper>
                    </navigation:Frame.UriMapper>
                </navigation:Frame>
        </Border>
     
        <Grid Style="{StaticResource NavigationOuterGridStyle}">
          <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">
     
            <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}">
              <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">
     
                <ContentControl Style="{StaticResource LogoIcon}"/>
                <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" 
                                   Text="{Binding ApplicationStrings.ApplicationName, Source={StaticResource ResourceWrapper}}"/>
     
              </StackPanel>
            </Border>
     
            <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}">
              <StackPanel x:Name="LinksStackPanel" Style="{StaticResource LinksStackPanelStyle}">
     
                <HyperlinkButton x:Name="Link1" Style="{StaticResource LinkStyle}" 
                                         NavigateUri="/Home" TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.HomePageTitle, Source={StaticResource ResourceWrapper}}"/>
     
                <Rectangle x:Name="Divider1" Style="{StaticResource DividerStyle}"/>
     
                <HyperlinkButton x:Name="Link2" Style="{StaticResource LinkStyle}" 
                                         NavigateUri="/About" TargetName="ContentFrame" Content="{Binding Path=ApplicationStrings.AboutPageTitle, Source={StaticResource ResourceWrapper}}"/>
     
              </StackPanel>
            </Border>
     
          </Grid>
     
          <Border x:Name="loginContainer" Style="{StaticResource LoginContainerStyle}">
              <!-- LoginStatus will be added here in code behind. This is required for the designer view to work -->           
          </Border>
        </Grid>
     
      </Grid>
     
    </UserControl>

    navrée !

  4. #4
    Membre émérite
    Avatar de Samuel Blanchard
    Homme Profil pro
    Expert .NET
    Inscrit en
    Février 2010
    Messages
    1 504
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 50
    Localisation : France

    Informations professionnelles :
    Activité : Expert .NET

    Informations forums :
    Inscription : Février 2010
    Messages : 1 504
    Points : 2 682
    Points
    2 682
    Par défaut
    Bonjour,

    A première vue, le problème à l'air de se situer dans les Styles.
    .
    Pas de question technique en MP, merci.
    .
    Un emulator Gameboy Color pour Windows Phone ?
    c'est moi qui l'ai fait

  5. #5
    Invité
    Invité(e)
    Par défaut
    Question bête, vu que t'as créé ton projet sans rien modifier alors vérifié que toutes les références à ton projet n'ont pas une petite icône jaune à côté ?

  6. #6
    Membre du Club
    Étudiant
    Inscrit en
    Février 2009
    Messages
    55
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2009
    Messages : 55
    Points : 49
    Points
    49
    Par défaut
    !!
    le soucis est dans BusyIndicator.xaml
    Code xml : 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
     
    <ResourceDictionary
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:appControls="clr-namespace:test_sl.Controls">
     
        <Style TargetType="appControls:BusyIndicator" x:Key="busyIndicatorDefaultStyle">
            <Setter Property="BusyContent" Value="Please wait..."/>
            <Setter Property="IsTabStop" Value="False"/>
            <Setter Property="OverlayStyle">
                <Setter.Value>
                    <Style TargetType="Rectangle">
                        <Setter Property="Fill" Value="White"/>
                        <Setter Property="Opacity" Value="0.5"/>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="ProgressBarStyle">
                <Setter.Value>
                    <Style TargetType="ProgressBar">
                        <Setter Property="IsIndeterminate" Value="True"/>
                        <Setter Property="Height" Value="15"/>
                        <Setter Property="Margin" Value="8,0,8,8"/>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="DisplayAfter" Value="00:00:00.1"/>
            <Setter Property="HorizontalAlignment" Value="Stretch"/>
            <Setter Property="VerticalAlignment" Value="Stretch"/>
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
            <Setter Property="VerticalContentAlignment" Value="Stretch"/>
            <Setter Property="Template">
                <Setter.Value>
                  <!-- l'erreur "XAML non valide" dans toute la balise ControleTemplate-->
                    <ControlTemplate TargetType="appControls:BusyIndicator">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="VisibilityStates">
                                    <VisualState x:Name="Hidden">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="busycontent" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="overlay" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Collapsed</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Visible">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="busycontent" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="overlay" Storyboard.TargetProperty="(UIElement.Visibility)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <Visibility>Visible</Visibility>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="BusyStatusStates">
                                    <VisualState x:Name="Idle">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="content" Storyboard.TargetProperty="(Control.IsEnabled)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <sys:Boolean>True</sys:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Busy">
                                        <Storyboard>
                                            <ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.001" Storyboard.TargetName="content" Storyboard.TargetProperty="(Control.IsEnabled)">
                                                <DiscreteObjectKeyFrame KeyTime="00:00:00">
                                                    <DiscreteObjectKeyFrame.Value>
                                                        <sys:Boolean>False</sys:Boolean>
                                                    </DiscreteObjectKeyFrame.Value>
                                                </DiscreteObjectKeyFrame>
                                            </ObjectAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <ContentControl
                                x:Name="content"
                                Content="{TemplateBinding Content}"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
                            <Rectangle
                                x:Name="overlay"
                                Style="{TemplateBinding OverlayStyle}"/>
                            <ContentPresenter
                                x:Name="busycontent">
                                <Grid
                                    HorizontalAlignment="Center"
                                    VerticalAlignment="Center">
                                    <Border
                                        Background="White"
                                        BorderThickness="1"
                                        CornerRadius="2">
                                        <Border.BorderBrush>
                                            <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                <GradientStop Color="#FFA3AEB9" Offset="0"/>
                                                <GradientStop Color="#FF8399A9" Offset="0.375"/>
                                                <GradientStop Color="#FF718597" Offset="0.375"/>
                                                <GradientStop Color="#FF617584" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.BorderBrush>
                                        <Border
                                            CornerRadius="1.5"
                                            Margin="1">
                                            <Border.Background>
                                                <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
                                                    <GradientStop Color="#FFF6F8F9" Offset="0.02"/>
                                                    <GradientStop Color="#FFB8B8B8" Offset="0.996"/>
                                                </LinearGradientBrush>
                                            </Border.Background>
                                            <Grid MinWidth="150">
                                                <Grid.RowDefinitions>
                                                    <RowDefinition/>
                                                    <RowDefinition Height="Auto"/>
                                                </Grid.RowDefinitions>
                                                <ContentPresenter
                                                    Content="{TemplateBinding BusyContent}"
                                                    ContentTemplate="{TemplateBinding BusyContentTemplate}"
                                                    Margin="8"/>
                                                <ProgressBar
                                                    Grid.Row="1"
                                                    Style="{TemplateBinding ProgressBarStyle}"/>
                                            </Grid>
                                        </Border>
                                    </Border>
                                </Grid>
                            </ContentPresenter>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
     
    </ResourceDictionary>

  7. #7
    Invité
    Invité(e)
    Par défaut
    J'avais eu ce même problème avec BusyIndicator mais ça marcher une fois que j'ai installé le toolkit qui se trouve ici. Ce que je ne comprenais pas vu que le code total du contrôle BusyIndicator se trouvait dans le projet.

    Bon tu peux essayer et voir si ça marche après installation.

  8. #8
    Membre du Club
    Étudiant
    Inscrit en
    Février 2009
    Messages
    55
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Février 2009
    Messages : 55
    Points : 49
    Points
    49
    Par défaut
    merci
    c'est bon ça marche (:

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

Discussions similaires

  1. XAML non valide
    Par Samyy17 dans le forum Visual Studio
    Réponses: 0
    Dernier message: 11/05/2014, 10h56
  2. Windows Phone xaml non valide ?
    Par Jyngle dans le forum Développement Windows
    Réponses: 8
    Dernier message: 18/04/2014, 17h42
  3. [Windows Phone 8] XAML non valide pourtant l'application fonctionne
    Par youtpout978 dans le forum Windows Phone
    Réponses: 4
    Dernier message: 03/03/2014, 20h18
  4. [Tomcat5] Insertion photo ds pdf. Chemin non valide?
    Par osmoze dans le forum Tomcat et TomEE
    Réponses: 2
    Dernier message: 21/09/2004, 11h12
  5. TThread et waitfor - descripteur non valide
    Par code34 dans le forum Langage
    Réponses: 2
    Dernier message: 27/10/2003, 23h44

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