protected override void OnElementChanged(ElementChangedEventArgs <Editor> e)
        {
            System.Diagnostics.Debug.WriteLine("Renderer Created");
            Console.WriteLine("Element Changed Called in Renderer!");

            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                ThisEditor = (HtmlEditor)e.NewElement;
                ThisEditor.HtmlRequested        += OnHtmlRequested;
                ThisEditor.HtmlSet              += OnHtmlSet;
                ThisEditor.StyleChangeRequested += OnStyleChangeRequested;
            }
            if (e.OldElement != null)
            {
                var oldEditor = (HtmlEditor)e.OldElement;
                oldEditor.HtmlRequested        -= OnHtmlRequested;
                oldEditor.HtmlSet              -= OnHtmlSet;
                oldEditor.StyleChangeRequested -= OnStyleChangeRequested;
            }
        }
Exemplo n.º 2
0
        protected override void OnElementChanged(ElementChangedEventArgs <Editor> e)
        {
            System.Diagnostics.Debug.WriteLine("Renderer Element Changed.");

            base.OnElementChanged(e);
            if (e.NewElement != null)
            {
                System.Diagnostics.Debug.WriteLine("Registering Event Handlers!");
                ThisEditor                         = (HtmlEditor)e.NewElement;
                Control.ScrollEnabled              = false;
                ThisEditor.HtmlRequested          += OnHtmlRequested;
                ThisEditor.HtmlSet                += OnHtmlSet;
                ThisEditor.SelectionChangeHandler += OnSelectionChanged;
                ThisEditor.StyleChangeRequested   += OnStyleChangeRequested;
            }
            if (e.OldElement != null)
            {
                var oldEditor = (HtmlEditor)e.OldElement;
                oldEditor.HtmlRequested          -= OnHtmlRequested;
                oldEditor.HtmlSet                -= OnHtmlSet;
                oldEditor.SelectionChangeHandler -= OnSelectionChanged;
                oldEditor.StyleChangeRequested   -= OnStyleChangeRequested;
            }
        }