Skip to content

Commit

Permalink
Merge pull request #38 from jsuarezruiz/master
Browse files Browse the repository at this point in the history
Added Forms EditorRenderer and Editor sample
  • Loading branch information
praeclarum authored Nov 29, 2017
2 parents 7756a9a + 6c9e0fc commit 0bebc81
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 0 deletions.
44 changes: 44 additions & 0 deletions Samples/EditorSample.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
using Ooui;
using Xamarin.Forms;

namespace Samples
{
public class EditorSample : ISample
{
public string Title => "Editor Sample";

public Ooui.Element CreateElement()
{
var panel = new StackLayout();

var titleLabel = new Xamarin.Forms.Label
{
Text = "Editor"
};
panel.Children.Add(titleLabel);

var editor = new Editor();
panel.Children.Add(editor);

var labelEditor = new Xamarin.Forms.Label();
panel.Children.Add(labelEditor);

editor.TextChanged += (sender, args) =>
{
labelEditor.Text = args.NewTextValue;
};

var page = new ContentPage
{
Content = panel
};

return page.GetOouiElement();
}

public void Publish()
{
UI.Publish("/editor", CreateElement);
}
}
}
1 change: 1 addition & 0 deletions Samples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ static void Main (string[] args)
new DrawSample ().Publish ();
new FilesSample ().Publish ();
new DisplayAlertSample ().Publish ();
new EditorSample().Publish();

UI.Present ("/display-alert");

Expand Down

0 comments on commit 0bebc81

Please sign in to comment.