public static void CheckEmptyControlBehaviour(this IMvxControl control, EmptyControlBehaviours?lastBehaviour)
        {
            if ((lastBehaviour.HasValue && lastBehaviour == EmptyControlBehaviours.Hide) ||
                (control.EmptyControlBehaviour == EmptyControlBehaviours.Hide && control.ViewModel != null))
            {
                control.ChangeVisibility(true);
            }

            if ((lastBehaviour.HasValue && lastBehaviour == EmptyControlBehaviours.Disable) ||
                (control.EmptyControlBehaviour == EmptyControlBehaviours.Disable && control.ViewModel != null))
            {
                control.ChangeVisibility(true);
            }

            if (control.ViewModel == null)
            {
                if (control.EmptyControlBehaviour == EmptyControlBehaviours.Hide)
                {
                    control.ChangeVisibility(false);
                }
                else if (control.EmptyControlBehaviour == EmptyControlBehaviours.Disable)
                {
                    control.ChangeEnabled(false);
                }
            }
        }
Пример #2
0
 public void Add(IMvxControl control)
 {
     if (!_controls.Contains(control))
     {
         _controls.Add(control);
     }
 }
 public void Remove(IMvxControl control)
 {
     _controls.Remove(control);
 }
 public void Add(IMvxControl control)
 {
     _controls.Add(control);
 }
 public void Remove(IMvxControl control)
 {
     _controls.Remove(control);
 }
 public void Add(IMvxControl control)
 {
     _controls.Add(control);
 }
 public static void CheckEmptyControlBehaviour(this IMvxControl control)
 {
     control.CheckEmptyControlBehaviour(null);
 }
 public static EmptyControlBehaviours GetDefaultEmptyControlBehaviour(this IMvxControl control)
 {
     return(EmptyControlBehaviours.Hide);
 }
 public void Add(IMvxControl control)
 {
     if (!_controls.Contains(control))
         _controls.Add(control);
 }