예제 #1
0
        private void MainWindow_Loaded(object sender, RoutedEventArgs e)
        {
            this.Loaded -= MainWindow_Loaded;

            this.FingerThumb   = new ThumbProxy();
            this.FingerThumb.X = (this.CvMain.ActualWidth - this.FingerThumb.Width) / 2d;
            this.FingerThumb.Y = (this.CvMain.ActualHeight - this.FingerThumb.Height) / 2d;
            this.CvMain.Children.Add(this.FingerThumb);

            this.HandThumb = new ThumbProxy();
            this.HandThumb.BackgroundColor = new SolidColorBrush(Colors.Red);
            this.HandThumb.X = (this.CvMain.ActualWidth - this.HandThumb.Width) / 2d;
            this.HandThumb.Y = (this.CvMain.ActualHeight - this.HandThumb.Height) / 2d;
            this.CvMain.Children.Add(this.HandThumb);
        }
        private static void BackgroundColorPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ThumbProxy oItem = obj as ThumbProxy;

            oItem.EllipseMain.Fill = (SolidColorBrush)e.NewValue;
        }
        private static void YPropertyChanged(DependencyObject obj, DependencyPropertyChangedEventArgs e)
        {
            ThumbProxy oItem = obj as ThumbProxy;

            oItem.TbkLocation.Text = (int)oItem.X + " " + (int)(double)e.NewValue;
        }