Exemplo n.º 1
0
        private void __initializeWPFElement(object caller, UIElement wpfElement)
        {
            IQGControl control = (IQGControl)caller;

            QGControlAdorner adorner = this.ControlAdorners[control];

            adorner.AdornerVisualCollection.Add(wpfElement);
        }
Exemplo n.º 2
0
        void IQGLayer.OnRemovingControl(IQGControl control)
        {
            if (!this.ControlAdorners.ContainsKey(control))
            {
                throw new Exception("Cannot remove control from binding layer: it is not present within the layer.");
            }

            control.SetParentLayer(null);
            QGControlAdorner adorner = this.ControlAdorners[control];

            this.ControlAdorners.Remove(control);
            this.WPFAdornerLayer?.Remove(adorner);

            this.OnRemovingControl(control);
        }
Exemplo n.º 3
0
        void IQGLayer.OnAddingControl(IQGControl control)
        {
            control.SetParentLayer(this);

            QGControlAdorner adorner = new QGControlAdorner(this.ParentControl);

            this.ControlAdorners.Add(control, adorner);
            this.WPFAdornerLayer?.Add(adorner);

            if (control is IWPFContainer wpfContainer)
            {
                wpfContainer.RegisterWPFElementInitMethod(__initializeWPFElement);
            }
            this.UpdateControlPosition(control);

            this.OnAddingControl(control);
        }