Example #1
0
        private BindableRunTextMedia DoCloseSelf(bool saveContent, Inline inline, TextElementCollection <Inline> inlines)
        {
            if (saveContent)
            {
                BindingExpression bindExpr = GetBindingExpression(TextProperty);
                if (bindExpr != null)
                {
                    bindExpr.UpdateSource();
                }

                //mLastInlineBoxed.OriginalText.setText(mLastInlineBoxed.Text);

                if (Text != OriginalText.Text)
                {
                    //newRun.Text = mLastInlineBoxed.Text;
                }
            }

            var newRun = new BindableRunTextMedia(OriginalText);

            InvalidateBinding();

            inlines.InsertAfter(inline, newRun);
            inlines.Remove(inline);

            return(newRun);
        }
Example #2
0
        void OnKeyUp(object sender, KeyEventArgs e)
        {
            if (e.Key == Key.Enter || e.Key == Key.Escape)
            {
                BindableRunTextMedia run = CloseSelf(e.Key == Key.Enter);

                // TODO:
                //App.mw2.addMouseButtonEventHandler(run);
                //App.mw2.ResetLastInlineBoxed();
            }
        }