public AimAnnotationComponentControl(AimAnnotationComponent component)
            : base(component)
        {
            _component = component;
            InitializeComponent();

            _bindingSource = new BindingSource();
            _bindingSource.DataSource = _component;

            SuspendLayout();

            var yOffset = 0;
            foreach(Control ctrl in Controls)
                yOffset = Math.Max(yOffset, ctrl.Bottom);
            yOffset = Math.Max(5, yOffset);
            var szTemplate = Size - new Size(Margin.Horizontal, Margin.Vertical + yOffset);
            _templateCtrlAimTemplate = new Template.TemplateControl(_component);
            _templateCtrlAimTemplate.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            _templateCtrlAimTemplate.Location = new Point(3, yOffset);
            _templateCtrlAimTemplate.Name = "_templateCtrlAimTemplate";
            _templateCtrlAimTemplate.Size = szTemplate;
            _templateCtrlAimTemplate.TabIndex = 2;

            Controls.Add(_templateCtrlAimTemplate);
            ResumeLayout(false);
            PerformLayout();
            InitializeAnnotationTypeCombo();

            _templateCtrlAimTemplate.DataBindings.Add("Visible", _bindingSource, "AimTemplateVisible", true, DataSourceUpdateMode.OnPropertyChanged);
            DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
        }
        public MarkupControl(AimAnnotationComponent component)
        {
            Component = component;
            MarkupListViewItems = new ObservableCollection<MarkupListViewItem>();

            InitializeComponent();

            Component.AimTemplateTreeMarkupChanged += OnAimTemplateTreeMarkupChanged;
            Loaded += MarkupControlLoaded;
        }
        public TemplateControl(AimAnnotationComponent component)
        {
            Platform.CheckForNullReference(component, "component");

            _component = component;
            InitializeComponent();

            _bindingSource            = new BindingSource();
            _bindingSource.DataSource = _component;

            _tboxAnnotationName.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _tboxAnnotationName.DataBindings.Add("Text", _bindingSource, "AnnotationName", true, DataSourceUpdateMode.OnPropertyChanged);

            _componentContainerControl.DataBindings.Add("SelectedTemplate", _bindingSource, "SelectedAimTemplate", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("SelectedAnatomicEntities", _bindingSource, "SelectedAnatomicEntities", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("SelectedImagingObservations", _bindingSource, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("SelectedInferences", _bindingSource, "SelectedInferences", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("IsValid", _bindingSource, "IsAimTemplateValid", true, DataSourceUpdateMode.OnPropertyChanged);

            _btnCreateAnnotation.DataBindings.Add("Enabled", _bindingSource, "CreateAnnotationEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _btnCreateAnnotation.EnabledChanged += BtnCreateAnnotationEnabledChanged;

            _component.AnnotationCreated += OnAnnotationCreated;

            try
            {
                var xp         = new AimAnnotationExtensionPoint();
                var extensions = xp.CreateExtensions();
                if (extensions.Length > 0)
                {
                    var extension = (IAimAnnotationExtension)extensions[0];
                    extension.Component    = _component;
                    _btnExtension1.Text    = extension.ButtonText;
                    _btnExtension1.Click  += extension.OnButtonClick;
                    _btnExtension1.Enabled = false;
                    _extensionControls.Add(_btnExtension1);
                }
            }
            catch (NotSupportedException ex)
            {
                Platform.Log(LogLevel.Error, ex, "Failed to create AimAnnotationExtension", null);
            }
        }
        public TemplateControl(AimAnnotationComponent component)
        {
            Platform.CheckForNullReference(component, "component");

            _component = component;
            InitializeComponent();

            _bindingSource = new BindingSource();
            _bindingSource.DataSource = _component;

            _tboxAnnotationName.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _tboxAnnotationName.DataBindings.Add("Text", _bindingSource, "AnnotationName", true, DataSourceUpdateMode.OnPropertyChanged);

            _componentContainerControl.DataBindings.Add("SelectedTemplate", _bindingSource, "SelectedAimTemplate", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("SelectedAnatomicEntities", _bindingSource, "SelectedAnatomicEntities", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("SelectedImagingObservations", _bindingSource, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("SelectedInferences", _bindingSource, "SelectedInferences", true, DataSourceUpdateMode.OnPropertyChanged);
            _componentContainerControl.DataBindings.Add("IsValid", _bindingSource, "IsAimTemplateValid", true, DataSourceUpdateMode.OnPropertyChanged);

            _btnCreateAnnotation.DataBindings.Add("Enabled", _bindingSource, "CreateAnnotationEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _btnCreateAnnotation.EnabledChanged += BtnCreateAnnotationEnabledChanged;

            _component.AnnotationCreated += OnAnnotationCreated;

            try
            {
                var xp = new AimAnnotationExtensionPoint();
                var extensions = xp.CreateExtensions();
                if (extensions.Length > 0)
                {
                    var extension = (IAimAnnotationExtension)extensions[0];
                    extension.Component = _component;
                    _btnExtension1.Text = extension.ButtonText;
                    _btnExtension1.Click += extension.OnButtonClick;
                    _btnExtension1.Enabled = false;
                    _extensionControls.Add(_btnExtension1);
                }
            }
            catch (NotSupportedException ex)
            {
                Platform.Log(LogLevel.Error, ex, "Failed to create AimAnnotationExtension", null);
            }
        }
        private AimAnnotationComponentWpfControl(AimAnnotationComponent component)
        {
            Component = component;
            InitializeComponent();

            InitializeAnnotationTypeCombo();
            InitializeTemplateControl();

            _buttonCreateAnnotation.IsEnabled = Component.CreateAnnotationEnabled;

            Component.TemplateTreeSet += OnTemplateTreeSet;
            Component.PropertyChanged += ComponentPropertyChanged;

            _buttonCreateAnnotation.IsEnabled = Component.CreateAnnotationEnabled;
            _buttonResetAnnotation.IsEnabled = Component.ResetButtonEnabled;
            _buttonUserInfo.IsEnabled = Component.UserInfoButtonEnabled;
            if (Component.CreateAnnotationEnabled)
                _buttonWhyIsTemplateIncomplete.Visibility = Visibility.Hidden;

            _btnExtension1.Visibility = Visibility.Hidden;

            try
            {
                // Create extension points that use this component
                AimAnnotationExtensionPoint xp = new AimAnnotationExtensionPoint();
                Object[] extensions = xp.CreateExtensions();
                if (extensions.Length > 0)
                {
                    IAimAnnotationExtension extension = (IAimAnnotationExtension)extensions[0];
                    extension.Component = Component;
                    _btnExtension1.Content = extension.ButtonText;
                    _btnExtension1.Click += extension.OnButtonClick;
                    _btnExtension1.Visibility = Visibility.Visible;
                    _btnExtension1.IsEnabled = false;
                }
            }
            catch (NotSupportedException ex)
            {
                Platform.Log(LogLevel.Error, ex, "Failed to create AimAnnotationExtension", null);
            }
        }
        public VasariTemplateCtrl(AimAnnotationComponent component)
        {
            _component = component;
            InitializeComponent();

            _bindingSource            = new BindingSource();
            _bindingSource.DataSource = _component;

//            this.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);

            _tboxAnnotationName.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _tboxAnnotationName.DataBindings.Add("Text", _bindingSource, "AnnotationName", true, DataSourceUpdateMode.OnPropertyChanged);

            // Values
            //_vasariFeatures.DataBindings.Add("SelectedAnatomicEntities", new BindingSource {DataSource = _component}, "SelectedAnatomicEntities", true, DataSourceUpdateMode.OnPropertyChanged);
            //_vasariFeatures.DataBindings.Add("SelectedImagingObservations", new BindingSource { DataSource = _component }, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
            _vasariFeatures.DataBindings.Add("SelectedAnatomicEntities", _bindingSource, "SelectedAnatomicEntities", true, DataSourceUpdateMode.OnPropertyChanged);
            _vasariFeatures.DataBindings.Add("SelectedImagingObservations", _bindingSource, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
            _vasariFeatures.DataBindings.Add("SelectedInferences", _bindingSource, "SelectedInferences", true, DataSourceUpdateMode.OnPropertyChanged);
            _vasariFeatures.DataBindings.Add("IsValid", _bindingSource, "IsVasariTemplateValid", true, DataSourceUpdateMode.OnPropertyChanged);

            _btnCreateAnnotation.DataBindings.Add("Enabled", _bindingSource, "CreateAnnotationEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
        }
        public void Show()
        {
            if (_shelves.ContainsKey(Context.DesktopWindow))
            {
                _shelves[Context.DesktopWindow].Activate();
            }
            else
            {
                BlockingOperation.Run(delegate
                                        {
                                            _desktopWindow = Context.DesktopWindow;
                                            var aimComponent = new AimAnnotationComponent(Context.DesktopWindow);
                                            var shelf = ApplicationComponent.LaunchAsShelf(
                                                _desktopWindow,
                                                aimComponent,
                                                SR.TitleAIMCreater,
                                                "AIM Annotation",
                                                ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);

                                            shelf.Closed += OnShelfClosed;
                                            _shelves[_desktopWindow] = shelf;
                                        });
            }
        }
 internal static void InitializeAimAnnotationWpfControl(AimAnnotationComponent component)
 {
     Instance = new AimAnnotationComponentWpfControl(component);
 }
        /// <summary>
        /// Constructor.
        /// </summary>
        public AimAnnotationComponentControl(AimAnnotationComponent component)
            :base(component)
        {
			_component = component;
            InitializeComponent();

            // Create Templates
            this.SuspendLayout();

			//const int yOffset = 5;
			const int yOffset = 32;
            Size szTemplate = this.Size - new Size(this.Margin.Horizontal, this.Margin.Vertical + yOffset);

            // Standard template
			_templateCtrlStandard = new StandardTemplateControl(_component);
			_templateCtrlStandard.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
			//        _templateCtrlStandard.CalculationInfo = ((System.Collections.Generic.List<string>)(resources.GetObject("_templateCtrlStandard.CalculationInfo")));
			_templateCtrlStandard.Location = new System.Drawing.Point(3, yOffset);
			_templateCtrlStandard.Name = "_templateCtrlStandard";
			_templateCtrlStandard.Size = szTemplate; // new Size(603, 561);
			_templateCtrlStandard.TabIndex = 2;

            // Vasari template
            _templateCtrlVasari = new VasariTemplateCtrl(_component);
            _templateCtrlVasari.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            _templateCtrlVasari.Location = new System.Drawing.Point(3, yOffset);
            _templateCtrlVasari.Name = "_templateCtrlVasari";
            _templateCtrlVasari.Size = szTemplate; // new Size(603, 561);
            _templateCtrlVasari.TabIndex = 2;

			this.Controls.Add(_templateCtrlStandard);
            this.Controls.Add(_templateCtrlVasari);
            this.ResumeLayout(false);
            this.PerformLayout();


            _bindingSource = new BindingSource();
			_bindingSource.DataSource = _component;

            _cmbAnnotationType.DataSource = _component.AvailableAnnotationTypes;

			// VK: Removed Statndard control for TCGA
			//_cmbAnnotationType.Enabled = false;
			//_cmbAnnotationType.Visible = false;
			//_lblAnnotationType.Visible = false;


			_templateCtrlStandard.DataBindings.Add("Visible", _bindingSource, "StandardTemplateVisible", true, DataSourceUpdateMode.OnPropertyChanged);
            _templateCtrlVasari.DataBindings.Add("Visible", _bindingSource, "VasariTemplateVisible", true, DataSourceUpdateMode.OnPropertyChanged);

            // Enable/disable ctrl
            this.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);

            //// Control State
            //_tboxAnnotationName.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //_anatomicEntity.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //_btnCreateAnnotation.DataBindings.Add("Enabled", _bindingSource, "CreateAnnotationEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //this.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);

            //// Values
            //_anatomicEntity.DataBindings.Add("SelectedAnatomicEntity", _bindingSource, "SelectedAnatomicEntity", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("SelectedImagingObservations", _bindingSource, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
            //_tboxAnnotationName.DataBindings.Add("Text", _bindingSource, "AnnotationName", true, DataSourceUpdateMode.OnPropertyChanged);
            //this.DataBindings.Add("CalculationInfo", _bindingSource, "CalculationInfo", true, DataSourceUpdateMode.OnPropertyChanged);

            //// Ontologies
            //_anatomicEntity.DataBindings.Add("DataSource", _bindingSource, "SelectedOntology", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("DataSource", _bindingSource, "SelectedOntology", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("ImagingObsCharacteristicDataSource", _bindingSource, "SelectedImgObsCharacteristicOntology", true, DataSourceUpdateMode.OnPropertyChanged);
        }
 /// <summary>
 /// Called by the host to assign this view to a component.
 /// </summary>
 public void SetComponent(IApplicationComponent component)
 {
     _component = (AimAnnotationComponent)component;
 }
        public StandardTemplateControl(AimAnnotationComponent component)
        {
            _component = component;
            InitializeComponent();

            _bindingSource = new BindingSource();
            _bindingSource.DataSource = _component;

            // Control State
            _tboxAnnotationName.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _anatomicEntity.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _imagingObservation.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _btnCreateAnnotation.DataBindings.Add("Enabled", _bindingSource, "CreateAnnotationEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
 //           this.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);

            // Values
			_anatomicEntity.DataBindings.Add("SelectedAnatomicEntities", _bindingSource, "SelectedAnatomicEntities", true, DataSourceUpdateMode.OnPropertyChanged);
            _imagingObservation.DataBindings.Add("SelectedImagingObservations", _bindingSource, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
            _tboxAnnotationName.DataBindings.Add("Text", _bindingSource, "AnnotationName", true, DataSourceUpdateMode.OnPropertyChanged);
            _tboxCalculation.DataBindings.Add("Lines", _bindingSource, "CalculationInfo", true, DataSourceUpdateMode.OnPropertyChanged);
			//this.DataBindings.Add("CalculationInfo", _bindingSource, "CalculationInfo", true, DataSourceUpdateMode.OnPropertyChanged);

            // Ontologies
            _anatomicEntity.DataBindings.Add("DataSource", _bindingSource, "SelectedOntology", true, DataSourceUpdateMode.OnPropertyChanged);
            _imagingObservation.DataBindings.Add("DataSource", _bindingSource, "SelectedOntology", true, DataSourceUpdateMode.OnPropertyChanged);
            _imagingObservation.DataBindings.Add("ImagingObsCharacteristicDataSource", _bindingSource, "SelectedImgObsCharacteristicOntology", true, DataSourceUpdateMode.OnPropertyChanged);
        }
示例#12
0
 public AimAnnotationComponentWpfHost(AimAnnotationComponent component) : base(component)
 {
     _component = component;
     InitializeComponent();
 }
		public void Show()
		{
			// check if a layout component is already displayed
			if (_shelves.ContainsKey(this.Context.DesktopWindow))
			{
				_shelves[this.Context.DesktopWindow].Activate();
			}
			else
			{
				_desktopWindow = this.Context.DesktopWindow;

				AimAnnotationComponent aimComponent = new AimAnnotationComponent(this.Context.DesktopWindow);

				IShelf shelf = ApplicationComponent.LaunchAsShelf(
					_desktopWindow,
					aimComponent,
					SR.TitleAIMCreater,
					"AIM Annotation",
					ShelfDisplayHint.DockRight | ShelfDisplayHint.DockAutoHide);

				shelf.Closed += OnShelfClosed;
				_shelves[_desktopWindow] = shelf;
			}
		}
        public TemplateWpfControl(AimAnnotationComponent component, AimAnnotationComponentWpfControl parentComponentControl)
        {
            Component = component;

            NodeControls = new List <IValidTreeControl>();

            if (component.AimTemplateTree != null)
            {
                TreeNodes = new List <AimTemplateTreeNode>(component.AimTemplateTree.TemplateNodes);
                TreeNodes.Sort(new TemplateTreeNodeOrderComparer());
            }
            else
            {
                TreeNodes = new List <AimTemplateTreeNode>();
            }

            InitializeComponent();

            _stackPanel.Children.Add(new AnnotationNameWpfControl(Component));

            var groupedNodes = new List <AimTemplateTreeNode>();

            foreach (AimTemplateTreeNode treeNode in TreeNodes)
            {
                // Start or add to group label control
                if (!String.IsNullOrEmpty(treeNode.GroupLabel))
                {
                    if (groupedNodes.Count > 0 && treeNode.GroupLabel == groupedNodes[0].GroupLabel)
                    {
                        groupedNodes.Add(treeNode);
                    }
                    else
                    {
                        // Finish and add the group label control
                        if (groupedNodes.Count > 0)
                        {
                            var groupLabel = new GroupLabelWpfControl(groupedNodes)
                            {
                                Header = groupedNodes[0].GroupLabel
                            };
                            _stackPanel.Children.Add(groupLabel);
                            NodeControls.Add(groupLabel);
                        }

                        groupedNodes = new List <AimTemplateTreeNode> {
                            treeNode
                        };
                    }
                }
                else
                {
                    // Finish and add the group label control
                    if (groupedNodes.Count > 0)
                    {
                        var groupLabel = new GroupLabelWpfControl(groupedNodes)
                        {
                            Header = groupedNodes[0].GroupLabel
                        };
                        groupedNodes.Clear();
                        _stackPanel.Children.Add(groupLabel);
                        NodeControls.Add(groupLabel);
                    }

                    if (treeNode is AimTemplateTreeAnatomicEntityNode)
                    {
                        var anatomicEntityControl =
                            new AnatomicEntityWpfControl((AimTemplateTreeAnatomicEntityNode)treeNode);
                        _stackPanel.Children.Add(anatomicEntityControl);
                        NodeControls.Add(anatomicEntityControl);
                    }
                    if (treeNode is AimTemplateTreeImagingObservationNode)
                    {
                        var imagingObservationControl =
                            new ImagingObservationWpfControl((AimTemplateTreeImagingObservationNode)treeNode);
                        _stackPanel.Children.Add(imagingObservationControl);
                        NodeControls.Add(imagingObservationControl);
                    }
                    if (treeNode is AimTemplateTreeInferenceNode)
                    {
                        var inferenceControl =
                            new InferenceWpfControl((AimTemplateTreeInferenceNode)treeNode);
                        _stackPanel.Children.Add(inferenceControl);
                        NodeControls.Add(inferenceControl);
                    }
                    if (treeNode is AimTemplateTreeGeometricShapeNode)
                    {
                        var geometricShapeControl =
                            new GeometricShapeWpfControl((AimTemplateTreeGeometricShapeNode)treeNode);
                        _stackPanel.Children.Add(geometricShapeControl);
                        NodeControls.Add(geometricShapeControl);
                    }
                    if (treeNode is AimTemplateTreeCalculationNode)
                    {
                        var calculationControl =
                            new CalculationWpfControl((AimTemplateTreeCalculationNode)treeNode);
                        _stackPanel.Children.Add(calculationControl);
                        NodeControls.Add(calculationControl);
                    }
                }
            }

            // Finish and add the group label control
            if (groupedNodes.Count > 0)
            {
                var groupLabel = new GroupLabelWpfControl(groupedNodes)
                {
                    Header = groupedNodes[0].GroupLabel
                };
                _stackPanel.Children.Add(groupLabel);
                NodeControls.Add(groupLabel);
            }
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public AimAnnotationComponentControl(AimAnnotationComponent component)
            : base(component)
        {
            _component = component;
            InitializeComponent();

            // Create Templates
            this.SuspendLayout();

            //const int yOffset = 5;
            const int yOffset    = 32;
            Size      szTemplate = this.Size - new Size(this.Margin.Horizontal, this.Margin.Vertical + yOffset);

            // Standard template
            _templateCtrlStandard        = new StandardTemplateControl(_component);
            _templateCtrlStandard.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            //        _templateCtrlStandard.CalculationInfo = ((System.Collections.Generic.List<string>)(resources.GetObject("_templateCtrlStandard.CalculationInfo")));
            _templateCtrlStandard.Location = new System.Drawing.Point(3, yOffset);
            _templateCtrlStandard.Name     = "_templateCtrlStandard";
            _templateCtrlStandard.Size     = szTemplate;         // new Size(603, 561);
            _templateCtrlStandard.TabIndex = 2;

            // Vasari template
            _templateCtrlVasari          = new VasariTemplateCtrl(_component);
            _templateCtrlVasari.Anchor   = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
            _templateCtrlVasari.Location = new System.Drawing.Point(3, yOffset);
            _templateCtrlVasari.Name     = "_templateCtrlVasari";
            _templateCtrlVasari.Size     = szTemplate; // new Size(603, 561);
            _templateCtrlVasari.TabIndex = 2;

            this.Controls.Add(_templateCtrlStandard);
            this.Controls.Add(_templateCtrlVasari);
            this.ResumeLayout(false);
            this.PerformLayout();


            _bindingSource            = new BindingSource();
            _bindingSource.DataSource = _component;

            _cmbAnnotationType.DataSource = _component.AvailableAnnotationTypes;

            // VK: Removed Statndard control for TCGA
            //_cmbAnnotationType.Enabled = false;
            //_cmbAnnotationType.Visible = false;
            //_lblAnnotationType.Visible = false;


            _templateCtrlStandard.DataBindings.Add("Visible", _bindingSource, "StandardTemplateVisible", true, DataSourceUpdateMode.OnPropertyChanged);
            _templateCtrlVasari.DataBindings.Add("Visible", _bindingSource, "VasariTemplateVisible", true, DataSourceUpdateMode.OnPropertyChanged);

            // Enable/disable ctrl
            this.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);

            //// Control State
            //_tboxAnnotationName.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //_anatomicEntity.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //_btnCreateAnnotation.DataBindings.Add("Enabled", _bindingSource, "CreateAnnotationEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            //this.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);

            //// Values
            //_anatomicEntity.DataBindings.Add("SelectedAnatomicEntity", _bindingSource, "SelectedAnatomicEntity", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("SelectedImagingObservations", _bindingSource, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
            //_tboxAnnotationName.DataBindings.Add("Text", _bindingSource, "AnnotationName", true, DataSourceUpdateMode.OnPropertyChanged);
            //this.DataBindings.Add("CalculationInfo", _bindingSource, "CalculationInfo", true, DataSourceUpdateMode.OnPropertyChanged);

            //// Ontologies
            //_anatomicEntity.DataBindings.Add("DataSource", _bindingSource, "SelectedOntology", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("DataSource", _bindingSource, "SelectedOntology", true, DataSourceUpdateMode.OnPropertyChanged);
            //_imagingObservation.DataBindings.Add("ImagingObsCharacteristicDataSource", _bindingSource, "SelectedImgObsCharacteristicOntology", true, DataSourceUpdateMode.OnPropertyChanged);
        }
 internal static void InitializeAimAnnotationWpfControl(AimAnnotationComponent component)
 {
     Instance = new AimAnnotationComponentWpfControl(component);
 }
 /// <summary>
 /// Called by the host to assign this view to a component.
 /// </summary>
 public void SetComponent(IApplicationComponent component)
 {
     _component = (AimAnnotationComponent)component;
 }
        public VasariTemplateCtrl(AimAnnotationComponent component)
        {
            _component = component;
            InitializeComponent();

            _bindingSource = new BindingSource();
            _bindingSource.DataSource = _component;

//            this.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);

            _tboxAnnotationName.DataBindings.Add("Enabled", _bindingSource, "AnnotationModuleEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
            _tboxAnnotationName.DataBindings.Add("Text", _bindingSource, "AnnotationName", true, DataSourceUpdateMode.OnPropertyChanged);

            // Values
			//_vasariFeatures.DataBindings.Add("SelectedAnatomicEntities", new BindingSource {DataSource = _component}, "SelectedAnatomicEntities", true, DataSourceUpdateMode.OnPropertyChanged);
			//_vasariFeatures.DataBindings.Add("SelectedImagingObservations", new BindingSource { DataSource = _component }, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
			_vasariFeatures.DataBindings.Add("SelectedAnatomicEntities", _bindingSource, "SelectedAnatomicEntities", true, DataSourceUpdateMode.OnPropertyChanged);
			_vasariFeatures.DataBindings.Add("SelectedImagingObservations", _bindingSource, "SelectedImagingObservations", true, DataSourceUpdateMode.OnPropertyChanged);
			_vasariFeatures.DataBindings.Add("SelectedInferences", _bindingSource, "SelectedInferences", true, DataSourceUpdateMode.OnPropertyChanged);
			_vasariFeatures.DataBindings.Add("IsValid", _bindingSource, "IsVasariTemplateValid", true, DataSourceUpdateMode.OnPropertyChanged);

            _btnCreateAnnotation.DataBindings.Add("Enabled", _bindingSource, "CreateAnnotationEnabled", true, DataSourceUpdateMode.OnPropertyChanged);
        }