Ejemplo n.º 1
0
 private void AlignmentEditor_Loaded(object sender, RoutedEventArgs e)
 {
     if (AlignmentControlHelper.GetLocalTargets(this) != null)
     {
         CheckTargetForCurrentAlignmentValues();
     }
 }
Ejemplo n.º 2
0
        private RadioButton GetActualRadioButton(HorizontalAlignment hAlignment, VerticalAlignment vAlignment)
        {
            List <RadioButton> localTargets = AlignmentControlHelper.GetLocalTargets(this);

            if (localTargets != null)
            {
                return(localTargets.FirstOrDefault(lt => GetEditorRole(lt) == alignmentAssociations[hAlignment, vAlignment].Key));
            }
            else
            {
                return(null);
            }
        }
Ejemplo n.º 3
0
        public void CheckTargetForCurrentAlignmentValues()
        {
            RadioButton actualTarget = GetActualRadioButton(HorizontalAlignmentValue, VerticalAlignmentValue);
            RadioButton checkedRB    = null;

            if (AlignmentControlHelper.GetLocalTargets(this) != null)
            {
                checkedRB = AlignmentControlHelper.GetLocalTargets(this).FirstOrDefault(rb => rb.IsChecked.HasValue && rb.IsChecked.Value);
            }
            if (checkedRB != null && actualTarget != checkedRB)
            {
                checkedRB.IsChecked = false;
            }
            if (actualTarget != null)
            {
                actualTarget.IsChecked = true;
            }
        }