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();
        }
Beispiel #3
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));
        }