Пример #1
0
        public virtual void PrepareContainerForItemOverrideSelector4()
        {
            IPoker      box  = CurrentControl;
            ListBoxItem item = (ListBoxItem)CreateContainer();

            box.PrepareContainerForItemOverride_(item, item);
            Assert.IsNull(item.Content);
        }
Пример #2
0
        public virtual void PrepareContainerForItemOverrideTest6()
        {
            Rectangle        rect = new Rectangle();
            IPoker           box  = CurrentControl;
            ContentPresenter item = new ContentPresenter();

            Assert.IsNull(item.Content);
            box.PrepareContainerForItemOverride_(item, rect);
            Assert.AreSame(item.Content, rect);
        }
Пример #3
0
        public virtual void PrepareContainerForItemOverrideTest5()
        {
            Rectangle rect = new Rectangle();
            IPoker    box  = CurrentControl;

            box.Items.Add(rect);
            ComboBoxItem item = new ComboBoxItem();

            Assert.Throws <InvalidOperationException> (() => box.PrepareContainerForItemOverride_(item, rect));
        }
Пример #4
0
        public virtual void PrepareContainerForItemOverrideSelector6()
        {
            Rectangle rect = new Rectangle();
            IPoker    box  = CurrentControl;

            box.Items.Add(rect);
            ListBoxItem item = (ListBoxItem)CreateContainer();

            Assert.Throws <InvalidOperationException> (() => box.PrepareContainerForItemOverride_(item, rect), "#2");
        }
Пример #5
0
        public virtual void PrepareContainerForItemOverrideSelector5()
        {
            Rectangle   rect = new Rectangle();
            IPoker      box  = CurrentControl;
            ListBoxItem item = (ListBoxItem)CreateContainer();

            Assert.IsNull(item.Content, "#1");
            box.PrepareContainerForItemOverride_(item, rect);
            Assert.AreSame(item.Content, rect, "#2");
        }
Пример #6
0
        public virtual void PrepareContainerForItemOverride_DisplayMemberPath()
        {
            IPoker poker = CurrentControl;

            ListBoxItem element = (ListBoxItem)poker.GetContainerForItemOverride_();
            string      item    = "hi";

            poker.DisplayMemberPath = "length";

            poker.PrepareContainerForItemOverride_(element, item);

            Assert.AreEqual(element.ReadLocalValue(ContentControl.ContentProperty), item, "binding is unset");
        }
Пример #7
0
        public virtual void PrepareContainerForItemOverride_defaults()
        {
            IPoker poker = CurrentControl;

            ListBoxItem element = (ListBoxItem)poker.GetContainerForItemOverride_();
            string      item    = "hi";

            poker.PrepareContainerForItemOverride_(element, item);

            Assert.AreEqual(element.Content, item, "string is content");
            Assert.IsNotNull(element.ContentTemplate, "content template is null");
            Assert.IsNull(element.Style, "style is null");
        }
Пример #8
0
        public virtual void PrepareContainerForItemOverrideTest3c()
        {
            IPoker           box  = CurrentControl;
            ContentPresenter item = new ContentPresenter();

            Assert.IsNull(item.Style);
            Assert.IsNull(item.Content);
            Assert.IsNull(item.ContentTemplate);

            box.PrepareContainerForItemOverride_(item, item);

            Assert.IsNull(item.Content);
            Assert.IsNull(item.ContentTemplate);
        }
Пример #9
0
        public virtual void PrepareContainerForItemOverrideTest3b()
        {
            IPoker      box  = CurrentControl;
            ListBoxItem item = new ListBoxItem();

            Assert.IsNull(item.Style);
            Assert.IsNull(item.Content);
            Assert.IsNull(item.ContentTemplate);

            box.PrepareContainerForItemOverride_(item, item);

            Assert.IsNull(item.Content);
            Assert.IsNull(item.ContentTemplate);
        }
Пример #10
0
        public virtual void PrepareContainerForItemOverride_IsSelected()
        {
            IPoker poker = CurrentControl;

            ListBoxItem element = (ListBoxItem)poker.GetContainerForItemOverride_();
            string      item    = "hi";

            element.IsSelected = true;

            poker.PrepareContainerForItemOverride_(element, item);

            Assert.IsNull(poker.SelectedItem, "selected item before it's been inserted");
            Assert.AreEqual(-1, poker.SelectedIndex, "-1 selected index");
        }
Пример #11
0
        public virtual void PrepareContainerForItemOverrideTest2b()
        {
            IPoker box = CurrentControl;

            box.PrepareContainerForItemOverride_((DependencyObject)box, null);
        }
Пример #12
0
        public virtual void PrepareContainerForItemOverrideTest2()
        {
            IPoker box = CurrentControl;

            box.PrepareContainerForItemOverride_(new Rectangle(), null);
        }
Пример #13
0
        public virtual void PrepareContainerForItemOverrideTest()
        {
            IPoker box = CurrentControl;

            box.PrepareContainerForItemOverride_(null, null);
        }