public void InitializeChilds(ViewDescriptionElement[] childs, int initialFocusedChild)
		{
			foreach (UIElement uiEle in _stackPanel.Children)
			{
				uiEle.GotFocus -= EhUIElement_GotFocus;
				uiEle.LostFocus -= EhUIElement_LostFocus;
			}

			_stackPanel.Children.Clear();
			foreach (var child in childs)
			{
				UIElement uiEle;

				uiEle = (UIElement)child.View;

				uiEle.GotFocus += EhUIElement_GotFocus;
				uiEle.LostFocus += EhUIElement_LostFocus;

				if (!string.IsNullOrEmpty(child.Title))
				{
					var gbox = new GroupBox();
					gbox.Header = child.Title;
					gbox.Content = uiEle;
					uiEle = gbox;
				}

				_stackPanel.Children.Add(uiEle);
			}

			_stackPanel.Children[initialFocusedChild].Focus();
		}
Beispiel #2
0
        protected virtual void Initialize()
        {
            if (null != _view)
            {
                _view.InitializeBegin();

                var controls = new ViewDescriptionElement[_childController.Length];
                for (int i = 0; i < controls.Length; i++)
                {
                    controls[i] = new ViewDescriptionElement(_childController[i].Title, _childController[i].View);
                }

                _view.InitializeLayout(_horizontalLayout);
                _view.InitializeDescription(_descriptionText);
                _view.InitializeChilds(controls, 0);

                _view.InitializeEnd();
            }
        }
Beispiel #3
0
    public void InitializeChilds(ViewDescriptionElement[] childs, int initialfocused)
    {
      // detach old childs from event chain
      for(int i=0;i<_childs.Length;i++)
      {
        _childs[i].SizeChanged -= EhChilds_SizeChanged;
        _childs[i].Enter -= EhChilds_Enter;
        _childs[i].Validated -= EhChilds_Validated;
      }
      this.Controls.Clear();
      this.Controls.Add(m_Label1);


      // now attach the new childs
      _childs = new Control[childs.Length];
      for(int i=0;i<_childs.Length;i++)
      {
        if(string.IsNullOrEmpty(childs[i].Title))
        {
          _childs[i] = (Control)childs[i].View;
          
          _childs[i].SizeChanged += EhChilds_SizeChanged;
          _childs[i].Enter += EhChilds_Enter;
          _childs[i].Validated += EhChilds_Validated;
        }
        else
        {
          GroupBox gbox = new GroupBox();
          gbox.Text = childs[i].Title;
          Control gboxchild = (Control)childs[i].View;

          int vertDistance = Math.Max(SystemInformation.CaptionHeight / 2, gbox.Padding.Top); 
          gboxchild.Location = new Point(gbox.Padding.Left, vertDistance);
          gbox.Controls.Add(gboxchild);
          gboxchild.Margin = new Padding(0, 0, 0, 0);
          gbox.Padding = new Padding(gbox.Padding.Left, gbox.Padding.Top, gbox.Padding.Right, 0);
          //gboxchild.BackColor = Color.Red;
          gbox.AutoSizeMode = AutoSizeMode.GrowAndShrink;
          gbox.AutoSize = true;
          _childs[i] = gbox;

          _childs[i].SizeChanged += EhChilds_SizeChanged;
          gboxchild.Enter += EhChilds_Enter;
          gboxchild.Validated += EhChilds_Validated;
        }
      }
    
      this.Controls.AddRange(_childs);
      LocateAndResize();
    }
Beispiel #4
0
		protected virtual void Initialize()
		{
			if (null != _view)
			{
				_view.InitializeBegin();

				ViewDescriptionElement[] controls = new ViewDescriptionElement[_childController.Length];
				for (int i = 0; i < controls.Length; i++)
					controls[i] = new ViewDescriptionElement(_childController[i].Title, _childController[i].View);

				_view.InitializeLayout(_horizontalLayout);
				_view.InitializeDescription(_descriptionText);
				_view.InitializeChilds(controls, 0);

				_view.InitializeEnd();
			}
		}
 public ViewDescriptionElement(ViewDescriptionElement from)
 {
     Title = from.Title;
     View  = from.View;
 }
		public ViewDescriptionElement(ViewDescriptionElement from)
		{
			this.Title = from.Title;
			this.View = from.View;
		}
 public ViewDescriptionElement(ViewDescriptionElement from)
 {
     this.Title = from.Title;
     this.View  = from.View;
 }