コード例 #1
0
        public double ConvertToXamlLayout(CoordinateAlignment alignment, double pixelValue)
        {
            var root = this.ItemsPanelRoot as PixelPanel;
            if (root != null)
            {
                return root.ConvertToXamlLayout(alignment, pixelValue);
            }

            return double.NaN;
        }
コード例 #2
0
        /// <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);
        }