1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| private void createSousChapitres()
{
var lesSousChapitres = from chapitre in _xml.Elements("chapitre") select chapitre;
foreach (var chapitre in lesSousChapitres)
{
ContentSousChapitre cnvSousChapitre;
cnvSousChapitre = new ContentSousChapitre();
cnvSousChapitre.SizeChanged += new SizeChangedEventHandler(onSizeChanged);
cnvSousChapitre.Width = cnvSousChapitres.Width;
cnvSousChapitre.SetValue(Canvas.LeftProperty, 0.0);
cnvSousChapitres.Children.Add(cnvSousChapitre);
}
}
private void onSizeChanged(object __currentTarget, SizeChangedEventArgs __event)
{
MessageBox.Show(__event.NewSize.Height.ToString());
} |
Partager