-
-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from jsuarezruiz/master
Added Forms EditorRenderer and Editor sample
- Loading branch information
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters