Ejemplo n.º 1
0
        private static void OnCornerOnlyChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            PositionPicker pp = (PositionPicker)sender;

            bool oldValue = (bool)e.OldValue;
            bool newValue = (bool)e.NewValue;

            pp.OnCornerOnlyChanged(oldValue, newValue);
        }
Ejemplo n.º 2
0
        private static void OnPositionSelectionChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e)
        {
            PositionPicker pp = (PositionPicker)sender;

            ContentAlignment oldPosition = (ContentAlignment)e.OldValue;
            ContentAlignment newPosition = (ContentAlignment)e.NewValue;

            pp.TopLeft.IsChecked      = false;
            pp.TopCenter.IsChecked    = false;
            pp.TopRight.IsChecked     = false;
            pp.MiddleLeft.IsChecked   = false;
            pp.MiddleCenter.IsChecked = false;
            pp.MiddleRight.IsChecked  = false;
            pp.BottomLeft.IsChecked   = false;
            pp.BottomCenter.IsChecked = false;
            pp.BottomRight.IsChecked  = false;

            if (newPosition == ContentAlignment.TopLeft)
            {
                pp.TopLeft.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.TopCenter)
            {
                pp.TopCenter.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.TopRight)
            {
                pp.TopRight.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.MiddleLeft)
            {
                pp.MiddleLeft.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.MiddleCenter)
            {
                pp.MiddleCenter.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.MiddleRight)
            {
                pp.MiddleRight.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.BottomLeft)
            {
                pp.BottomLeft.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.BottomCenter)
            {
                pp.BottomCenter.IsChecked = true;
            }
            else if (newPosition == ContentAlignment.BottomRight)
            {
                pp.BottomRight.IsChecked = true;
            }

            pp.OnPositionSelectionChanged(oldPosition, newPosition);
        }