Ejemplo n.º 1
0
 internal BinderController(Binder binder, IBinderModel model)
 {
     _binder = binder;
     _views = new List<BinderViewBase>();
     _model = model;
     _model.Controller = this;
 }
Ejemplo n.º 2
0
        public PasteUpForm()
        {
            InitializeComponent();

            _pasteUp = new PasteUpControl();
            _pasteUp.Parent = this;
            _pasteUp.Dock = DockStyle.Fill;
            _pasteUp.MouseDown += new MouseEventHandler(_pasteUp_MouseDown);

            Binder formBinder = new Binder(this);
            Binder controlBinder = new Binder(formBinder, "PasteUpControl");
            controlBinder.AddBinding("Text", new PropertyView(this, "Text", "Unknown"));
        }
Ejemplo n.º 3
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            _mainFormBinder = new Binder(this);
            _selectedFormBinder = new Binder(_mainFormBinder, "SelectedForm");
            _selectedPasteUpBinder = new Binder(_selectedFormBinder, "PasteUpControl");

            PanelPerTypeView panelPerTypeView = new PanelPerTypeView();
            panelPerTypeView.NullPanel = _noPropertiesPanel;
            panelPerTypeView.AddPanel(typeof(LabelDocumentFrame), _labelPropertiesPanel);
            _selectedPasteUpBinder.AddBinding("SelectedFrame", panelPerTypeView);

            Binder labelPropertiesBinder = new Binder();
            _selectedPasteUpBinder.AddBinding("SelectedFrame", new PropertyView(labelPropertiesBinder, "BoundTo", null, true),
                new TypeFilterConverter<LabelDocumentFrame>());

            labelPropertiesBinder.AddBinding("Label", new BaseEditBinderView(_labelLabel));
            labelPropertiesBinder.AddBinding("Caption", new BaseEditBinderView(_labelCaption));

            MdiChildActivate += new EventHandler(MainForm_MdiChildActivate);
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Binder"/> class, and creates 
 /// a binding on an underlying binder to update this binders BoundTo property.
 /// </summary>
 /// <param name="boundToBinder">The binder to create the binding on.</param>
 /// <param name="propertyName">Name of the property to bind to.</param>
 /// <param name="readOnly">A boolean indicating whether the binding should be bidirectional or read only.</param>
 public Binder(Binder boundToBinder, string propertyName, bool readOnly)
     : this()
 {
     boundToBinder.AddBinding(propertyName, new PropertyView(this, "BoundTo", null, readOnly));
 }