Esempio n. 1
0
        /// <summary>
        /// Place the photo tagger to the bottom left of given point.
        /// </summary>
        /// <param name="photoViewer">PhotoViewerControl which holds the tagger control.</param>
        /// <param name="topRightCorner">Top right corner point of tagger.</param>
        private static void PlaceTaggerControl(PhotoViewerControl photoViewer, Point topRightCorner)
        {
            double widthByTwo  = photoViewer._tagTarget.Width / 2;
            double heightByTwo = photoViewer._tagTarget.Height / 2;

            double x = topRightCorner.X - photoViewer._photoTagger.Width - widthByTwo;
            double y = topRightCorner.Y - heightByTwo;

            if (topRightCorner.Y + photoViewer._photoTagger.Height > photoViewer._photoDisplayGrid.ActualHeight)
            {
                y = photoViewer._photoDisplayGrid.ActualHeight - photoViewer._photoTagger.Height - heightByTwo;
            }

            if (topRightCorner.X - widthByTwo < photoViewer._photoTagger.Width)
            {
                x = topRightCorner.X + widthByTwo;
            }

            photoViewer._photoTagger.TransformPoint = new Point(x, y);
        }
Esempio n. 2
0
 private void owner_PreviewMouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e)
 {
     PhotoViewerControl.HandleScrollViewerMouseWheel((ScrollViewer)sender, false, e);
 }