Bonjour,
J'utilise le Silverlight Toolkit 4 et j'ai un problème pour lier les données :
Le XAML :
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <chartingToolkit:Chart Grid.Column="1"> <chartingToolkit:Chart.Series> <chartingToolkit:LineSeries Title="PSNR" ItemsSource="{Binding Data, Source={StaticResource ImagesGraph}}" IndependentValueBinding="{Binding Name}" DependentValueBinding="{Binding MOSp}" AnimationSequence="FirstToLast"/> </chartingToolkit:Chart.Series> <chartingToolkit:Chart.Axes> <chartingToolkit:CategoryAxis Title="Images" Orientation="X" /> <chartingToolkit:LinearAxis Title="MOSp" Orientation="Y" Minimum="0" Maximum="1.05" Interval="0.2" ShowGridLines="True" /> </chartingToolkit:Chart.Axes> </chartingToolkit:Chart>
La classe ImagesGraph :
Mais pour Source={StaticResource ImagesGraph} il me dit qu'il ne peut pas résoudre la ressource
Code c# : 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 public class ImagesGraph : INotifyPropertyChanged { public string name { get; set; } public string Name { get { return name; } set { name = value; NotifyPropertyChanged("Name"); } } public double mosp { get; set; } public double MOSp { get { return mosp; } set { mosp = value; NotifyPropertyChanged("MOSp"); } } public static ObservableCollection<ImagesGraph> Data { get { ObservableCollection<ImagesGraph> data = new ObservableCollection<ImagesGraph>(); data.Add(new ImagesGraph { Name = "Toto_0", MOSp = 0.2 }); data.Add(new ImagesGraph { Name = "Toto_1", MOSp = 0.3 }); data.Add(new ImagesGraph { Name = "Toto_2", MOSp = 0.72 }); data.Add(new ImagesGraph { Name = "Toto_3", MOSp = 0.78 }); data.Add(new ImagesGraph { Name = "Toto_4", MOSp = 0.96 }); return data; } } public ImagesGraph() { } }![]()
Partager