Inheritance: WindowlessLabel, IInteractiveContentPresenter
Exemple #1
0
        public int Add(object value)
        {
            IInteractiveContentPresenter contentPresenter;

            if (myControl.ContentPresenter == null)
            {
                contentPresenter = new WindowlessLabelPresenter();
            }
            else
            {
                contentPresenter = Activator.CreateInstance(myControl.ContentPresenter) as IInteractiveContentPresenter;
            }

            int ret = myList.Add(value);

            myLayoutControl.Controls.Add(contentPresenter);
            // changing the content may trigger resizes. so get the control situated in the container first,
            // so when it resizes it has a context.
            contentPresenter.Content = value;
            if (myControl.Focused && myList.Count != 0)
            {
                myControl.SelectedIndex = 0;
            }
            return(ret);
        }
Exemple #2
0
        public void Insert(int index, object value)
        {
            IInteractiveContentPresenter contentPresenter;

            if (myControl.ContentPresenter == null)
            {
                contentPresenter = new WindowlessLabelPresenter();
            }
            else
            {
                contentPresenter = Activator.CreateInstance(myControl.ContentPresenter) as IInteractiveContentPresenter;
            }

            myList.Insert(index, value);
            myLayoutControl.Controls.Insert(index, contentPresenter);
            // changing the content may trigger resizes. so get the control situated in the container first,
            // so when it resizes it has a context.
            contentPresenter.Content = value;
        }
        public int Add(object value)
        {
            IInteractiveContentPresenter contentPresenter;
            if (myControl.ContentPresenter == null)
            {
                contentPresenter = new WindowlessLabelPresenter();
            }
            else
            {
                contentPresenter = Activator.CreateInstance(myControl.ContentPresenter) as IInteractiveContentPresenter;
            }

            int ret = myList.Add(value);
            myLayoutControl.Controls.Add(contentPresenter);
            // changing the content may trigger resizes. so get the control situated in the container first,
            // so when it resizes it has a context.
            contentPresenter.Content = value;
            if (myControl.Focused && myList.Count != 0)
                myControl.SelectedIndex = 0;
            return ret;
        }
        public void Insert(int index, object value)
        {
            IInteractiveContentPresenter contentPresenter;
            if (myControl.ContentPresenter == null)
            {
                contentPresenter = new WindowlessLabelPresenter();
            }
            else
            {
                contentPresenter = Activator.CreateInstance(myControl.ContentPresenter) as IInteractiveContentPresenter;
            }

            myList.Insert(index, value);
            myLayoutControl.Controls.Insert(index, contentPresenter);
            // changing the content may trigger resizes. so get the control situated in the container first,
            // so when it resizes it has a context.
            contentPresenter.Content = value;
        }