Example #1
0
        public void then_overridden_property_has_different_bindable_instance()
        {
            FrameworkEditorBindableProperty original   = (FrameworkEditorBindableProperty)propertyWithFxEditor.BindableProperty;
            FrameworkEditorBindableProperty overridden = (FrameworkEditorBindableProperty)overriddenPropertyWithFxEditor.BindableProperty;

            Assert.AreNotSame(original, overridden);
        }
        public void then_editor_is_returned_as_ui_element()
        {
            FrameworkEditorBindableProperty frameworkEditorBindable = (FrameworkEditorBindableProperty)property.BindableProperty;

            Assert.IsNotNull(frameworkEditorBindable.CreateEditorInstance());
            Assert.AreNotSame(editorInstance, frameworkEditorBindable.CreateEditorInstance());
            editorInstance = frameworkEditorBindable.CreateEditorInstance();
        }
        public void then_editor_specified_in_editor_attributes_sets_has_editor()
        {
            Assert.IsInstanceOfType(property.BindableProperty, typeof(FrameworkEditorBindableProperty));

            FrameworkEditorBindableProperty frameworkEditorBindable = (FrameworkEditorBindableProperty)property.BindableProperty;

            Assert.AreNotSame(editorInstance, frameworkEditorBindable.CreateEditorInstance());
            editorInstance = frameworkEditorBindable.CreateEditorInstance();
        }
Example #4
0
        public FrameworkElementUITypeEditor(Property property, FrameworkEditorBindableProperty bindableProperty)
        {
            Guard.ArgumentNotNull(bindableProperty, "bindableProperty");

            this.property = property;

            FrameworkElement editorInstance = bindableProperty.CreateEditorInstance();

            editorInstance.DataContext = bindableProperty;
            scrollViewer = new ScrollViewer {
                HorizontalAlignment = System.Windows.HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch
            };
            scrollViewer.Content = editorInstance;
            host = new ElementHost {
                Child = scrollViewer, Dock = DockStyle.Fill
            };

            host.Resize  += HostResize;
            hostContainer = new Winforms.UserControl();
            hostContainer.Controls.Add(host);
        }
        public void then_editor_data_context_is_BindableProperty()
        {
            FrameworkEditorBindableProperty frameworkEditorBindable = (FrameworkEditorBindableProperty)property.BindableProperty;

            Assert.IsInstanceOfType(frameworkEditorBindable.CreateEditorInstance().DataContext, typeof(BindableProperty));
        }
Example #6
0
        public void then_overridden_property_bindable_was_created_for_property()
        {
            FrameworkEditorBindableProperty overridden = (FrameworkEditorBindableProperty)overriddenPropertyWithFxEditor.BindableProperty;

            Assert.AreEqual(overriddenPropertyWithFxEditor, overridden.Property);
        }