Exemple #1
0
        public void Process(IScreenBinder binder)
        {
            binder.InsideLatch(
                delegate
            {
                foreach (Control control in _allControls.AllControls)
                {
                    IScreenElement element = binder.FindElementForControl(control);
                    if (element == null)
                    {
                        control.Hide();
                    }
                    else
                    {
                        element.Hide();
                    }
                }

                foreach (Control control in _controls.AllControls)
                {
                    IScreenElement element = binder.FindElementForControl(control);
                    if (element == null)
                    {
                        control.Show();
                    }
                    else
                    {
                        element.Show();
                    }
                }
            });
        }
        public PropertyBindingExpression ToVisibilityOf(params Control[] controls)
        {
            foreach (Control control in controls)
            {
                IScreenElement element = _binder.FindElementForControl(control) ??
                                         new ScreenElement <Control>(control);

                element.BindVisibilityTo(_accessor);
                _binder.AddElement(element);
            }

            return(this);
        }