Cleaned up sample code using DisplayAlert
This commit is contained in:
parent
2b8ce39a5c
commit
0ccc89a325
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using Ooui;
|
||||||
|
using System;
|
||||||
|
|
||||||
using Xamarin.Forms;
|
using Xamarin.Forms;
|
||||||
using Xamarin.Forms.Xaml;
|
using Xamarin.Forms.Xaml;
|
||||||
|
@ -18,5 +19,11 @@ namespace Samples
|
||||||
var result = await DisplayAlert("Alert Message", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa.", "YES", "NO");
|
var result = await DisplayAlert("Alert Message", "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa.", "YES", "NO");
|
||||||
await DisplayAlert("Alert Response", $"You selected value: {result}", "OK");
|
await DisplayAlert("Alert Response", $"You selected value: {result}", "OK");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Publish()
|
||||||
|
{
|
||||||
|
var sample = new XamlPageSample();
|
||||||
|
UI.Publish("/display-alert", sample.CreateElement(this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,11 +29,9 @@ namespace Samples
|
||||||
new TodoSample ().Publish ();
|
new TodoSample ().Publish ();
|
||||||
new DrawSample ().Publish ();
|
new DrawSample ().Publish ();
|
||||||
new FilesSample ().Publish ();
|
new FilesSample ().Publish ();
|
||||||
|
new DisplayAlertSample ().Publish ();
|
||||||
|
|
||||||
var sample = new XamlPageSample();
|
UI.Present ("/display-alert");
|
||||||
UI.Publish("/display-alert", sample.CreateElement(new DisplayAlertSample()));
|
|
||||||
|
|
||||||
UI.Present ("/display-alert", sample);
|
|
||||||
|
|
||||||
Console.ReadLine ();
|
Console.ReadLine ();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue