public double ConvertToXamlLayout(CoordinateAlignment alignment, double pixelValue) { var root = this.ItemsPanelRoot as PixelPanel; if (root != null) { return root.ConvertToXamlLayout(alignment, pixelValue); } return double.NaN; }
/// <summary> /// Obtenir une valeur en XAML à partir d'une valeur en pixel (position, taille) /// </summary> /// <param name="alignment"></param> /// <param name="pixelValue"></param> /// <returns></returns> public double ConvertToXamlLayout(CoordinateAlignment alignment, double pixelValue) { if (IsReadyForLayout) { if (alignment == CoordinateAlignment.Horizontal) { return((pixelValue * this.ImageWidth) / this.PixelWidth); } return((pixelValue * this.ImageHeight) / this.PixelHeight); } return(double.NaN); }