Esempio n. 1
0
 public ToolbarItem EditItem()
 {
     return
         (new ToolbarItem("Edit", "icons8pencil96", async() => {
         if (editor.IsEditable())
         {
             if (isKeyboardUp)
             {
                 editor.HideInputMethod();
             }
             else
             {
                 editor.ShowInputMethod();
             }
         }
         else
         {
             SetModel(modelInfo.Copy(), editable: true);
             editor.ShowInputMethod();
         }
     }));
 }
Esempio n. 2
0
        public Button BtnInsertText(ICustomTextEdit editor, string title, int fontSize, string str)
        {
            Button button = new Button()
            {
                Margin            = 0, BorderWidth = 0, Padding = 0,
                Text              = title,
                HeightRequest     = MainTabbedPage.buttonHeightRequest,
                HorizontalOptions = LayoutOptions.CenterAndExpand,
                BackgroundColor   = MainTabbedPage.secondBarColor,
                FontSize          = fontSize,
            };

            button.Clicked += async(object sender, EventArgs e) => {
                editor.InsertText(str);
                if (Gui.platform != Kaemika.Platform.iOS)
                {
                    editor.ShowInputMethod();
                }
            };
            return(button);
        }