Bonjour

J'ai un petit problème et j'ai beau réfléchir et je ne vois pas comment le contourner.

J'ai un fichier generic.xaml dans lequel je définie une zone "conteneur". Dans celle-ci, je place des contrôles qui sont aussi définie dans ce même fichier.
Tout marche sauf quand je dois insérer un de mes contrôle pouvant contenir du contenu. En effet, Visual Studio m'indique l'erreur :

Erreur 4 La propriété 'Content' est définie plusieurs fois. Page.xaml 27 17 SilverlightApp
Voici le code de mon XAML :
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
 
<Style TargetType="local:TaskMenuControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:TaskMenuControl">
                    <Canvas x:Name="TaskPanel"
                                Background="{TemplateBinding Background}"
                                Opacity="{TemplateBinding Opacity}"
                                Height="{TemplateBinding Height}">
 
                        <ContentControl x:Name="ContentLayout" 
                                        Content="{TemplateBinding Content}" />
 
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
 
<Style TargetType="local:EventNotifierControl">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:EventNotifierControl">
                    <Canvas x:Name="EventNotifierPanel"
                                Background="{TemplateBinding Background}"
                                Opacity="{TemplateBinding Opacity}"
                                Height="{TemplateBinding Height}"
                                Width="{TemplateBinding Width}">
 
                        <vsm:VisualStateManager.VisualStateGroups>
                            <vsm:VisualStateGroup x:Name="NotificationEvent">
                                <vsm:VisualState x:Name="NotifyAnimation">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="EventIcon" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                                            <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.150" Value="-20"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.300" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.450" Value="-15"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.600" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.750" Value="-10"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:00.900" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:01.050" Value="-5"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:01.200" Value="0"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:01.350" Value="-2.5"/>
                                            <SplineDoubleKeyFrame KeyTime="00:00:01.500" Value="0"/>
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </vsm:VisualState>
                            </vsm:VisualStateGroup>
                        </vsm:VisualStateManager.VisualStateGroups>
 
 
                        <Button x:Name="EventAction">
                            <Image Width="{TemplateBinding Width}" 
                                   Height="{TemplateBinding Height}" 
                                   Source="{TemplateBinding IconSrc}" 
                                   Stretch="Fill" 
                                   x:Name="EventIcon" 
                                   RenderTransformOrigin="0.5,0.5">
 
                                <Image.RenderTransform>
                                    <TransformGroup>
                                        <ScaleTransform ScaleX="1" ScaleY="1"/>
                                        <SkewTransform AngleX="0" AngleY="0"/>
                                        <RotateTransform Angle="0"/>
                                        <TranslateTransform X="0" Y="0"/>
                                    </TransformGroup>
                                </Image.RenderTransform>
 
                            </Image>
                        </Button>
 
                        <Image Width="{TemplateBinding Width}" 
                               Height="{TemplateBinding Height}" 
                               Source="{TemplateBinding IndicatorNumberSrc}" 
                               Stretch="Fill"
                               Visibility="{TemplateBinding IndicatorVisibility}"
                               x:Name="EventNumberLogo"/>
 
                        <TextBlock Width="25" 
                                 Height="25"
                                 x:Name="EventNumber"
                                 Foreground="White"
                                 FontSize="12"                                 
                                 Visibility="{TemplateBinding IndicatorVisibility}"></TextBlock>
 
                    </Canvas>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
Le problème apparait quand je bind ou utilise la propriété "Text" du contrôle TextBlock.

Quelqu'un connait-il une solution à ce problème ?

Merci d'avance