Bonjour,
après de très longues opérations d'adaptation de code, modification de références, j'ai passé un projet vs2008 .net 3.5 Sl3 & ria services à vs2010 .net 4.0 Sl4 & wcf services. j'en ai encore les nerfs en pelote ^^
bref mon projet se charge mais la page blanchit d'un coup lors d'un context.load dans un partial class (page enfant donc). peut-être manque-t-il une adaptation dans mon xaml... le .cs semble correct...
Home.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 <ItemsControl Grid.Column="0" x:Name="ICtoBind"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <StackPanel Orientation="Vertical" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Button x:Name="{Binding CHRONO}" Style="{StaticResource GlassButtonStyle}" Click="Navigation_Click"> <StackPanel> <TextBlock Text="{Binding NOM}" /> <TextBox Name="btnType" Visibility="Collapsed" Text="{Binding TYPE}" /> <TextBox Name="btnCible" Visibility="Collapsed" Text="{Binding CIBLE}" /> </StackPanel> </Button> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> ...
Home.xaml.cs
ctx.Load<SSCATEGORIE>(ctx.GetSSCATEGORIEByNvQuery(qs, 0), true) :
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 void Home_Loaded(object sender, RoutedEventArgs e) { FBContext ctx = new FBContext(); int laccueil = 0; if (this.NavigationContext.QueryString.ContainsKey("id")) { Int32 qs = Convert.ToInt32(this.NavigationContext.QueryString["id"]); ctx.Load<CATEGORIE>(ctx.GetUneCATEGORIEQuery(qs)).Completed += (sendeur, args) => { List<CATEGORIE> liste = ((LoadOperation<CATEGORIE>)sendeur).Entities.ToList(); foreach (CATEGORIE Item in liste) { if (Item.ACCUEIL.HasValue) laccueil = (int)Item.ACCUEIL; } TBmessage.Text += laccueil; ICtoBind.ItemsSource = ctx.SSCATEGORIEs; // ça bloque ici !!! ctx.Load<SSCATEGORIE>(ctx.GetSSCATEGORIEByNvQuery(qs, 0), true).Completed += (sendeur2, args2) => { List<SSCATEGORIE> liste2 = ((LoadOperation<SSCATEGORIE>)sendeur2).Entities.ToList(); foreach (SSCATEGORIE Item2 in liste2) { if (laccueil == (int)Item2.CHRONO) { Navigation((int)Item2.TYPE, Convert.ToString(Item2.CHRONO), Item2.CIBLE); } } }; }; } }
ctx.GetSSCATEGORIEByNvQuery(qs, 0) fonctionne, mais lors du ctx.Load<SSCATEGORIE>, ma page se bloque avec l'erreur bateau :
en dissociant , je constate bien le blocage sur ctx.load :Erreur*: Erreur non gérée dans l'application Silverlight
Code: 1001
Categorie: ParserError
Message: AG_E_UNKNOWN_ERROR
Fichier:
Ligne: 38
Position: 111
Fichier Source*: http://localhost:52878/default.htm
Ligne*: 56
si vous avez un indice, un besoin de code supplémentaire, n'hésitez pas !! je suis dans une impasse...
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 EntityQuery<SSCATEGORIE> tmp = ctx.GetSSCATEGORIEByNvQuery(qs, 0); ctx.Load<SSCATEGORIE>(tmp) <- page blanche
Merci d'avance.
Partager