Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ private async void StopEditTransaction(object sender, EventArgs e)
try
{
// Ask the user if they want to commit or rollback the transaction (or cancel to keep working in the transaction).
string choice = await DisplayActionSheet("Transaction", "Cancel", null, "Commit", "Rollback");
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Transaction", "Cancel", null, "Commit", "Rollback");

if (choice == "Commit")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ private async Task ChangeRenderingRuleAsync()
try
{
// Display a picker to the user to choose among the available rendering rules for the image service raster
string myRenderingRuleInfoName = await DisplayActionSheet("Select a Rendering Rule", "Cancel", null, _names.ToArray());
string myRenderingRuleInfoName = await Application.Current.Windows[0].Page.DisplayActionSheet("Select a Rendering Rule", "Cancel", null, _names.ToArray());

// Loop through each rendering rule info in the image service raster
foreach (RenderingRuleInfo myRenderingRuleInfo in _myReadOnlyListRenderRuleInfos)
Expand Down
6 changes: 3 additions & 3 deletions src/MAUI/Maui.Samples/Samples/Map/AuthorMap/AuthorMap.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ private async void Basemap_Clicked(object sender, EventArgs e)
{
try
{
string selectionName = await DisplayActionSheet("Select basemap", "Cancel", null, _basemaps.Keys.ToArray());
string selectionName = await Application.Current.Windows[0].Page.DisplayActionSheet("Select basemap", "Cancel", null, _basemaps.Keys.ToArray());

if (selectionName == "Cancel") return;

Expand All @@ -181,7 +181,7 @@ private async void Add_Clicked(object sender, EventArgs e)
{
string[] inMapNames = MyMapView.Map.OperationalLayers.Select(l => l.Name).ToArray();
string[] optionNames = _operationalLayerUrls.Where(l => !inMapNames.Contains(l.Key)).Select(l => l.Key).ToArray();
string selectionName = await DisplayActionSheet("Select layer to add", "Cancel", null, optionNames);
string selectionName = await Application.Current.Windows[0].Page.DisplayActionSheet("Select layer to add", "Cancel", null, optionNames);

if (selectionName == "Cancel") return;

Expand All @@ -204,7 +204,7 @@ private async void Remove_Clicked(object sender, EventArgs e)
{
try
{
string selectionName = await DisplayActionSheet("Select layer to remove", "Cancel", null, MyMapView.Map.OperationalLayers.Select(l => l.Name).ToArray());
string selectionName = await Application.Current.Windows[0].Page.DisplayActionSheet("Select layer to remove", "Cancel", null, MyMapView.Map.OperationalLayers.Select(l => l.Name).ToArray());

if (selectionName == "Cancel") return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ private async void OnMapsClicked(object sender, EventArgs e)
try
{
// Show sheet and get title from the selection
string selectedMapTitle = await DisplayActionSheet("Select map", "Cancel", null, _titles);
string selectedMapTitle = await Application.Current.Windows[0].Page.DisplayActionSheet("Select map", "Cancel", null, _titles);

// If selected cancel do nothing
if (selectedMapTitle == null || selectedMapTitle == "Cancel") return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private async void OnViewpointsClicked(object sender, EventArgs e)
{
// Show sheet and get title from the selection
string selectedMapTitle =
await DisplayActionSheet("Select viewpoint", "Cancel", null, titles);
await Application.Current.Windows[0].Page.DisplayActionSheet("Select viewpoint", "Cancel", null, titles);

// If selected cancel do nothing
if (selectedMapTitle == "Cancel") return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ private async void OnButtonClicked(object sender, EventArgs e)
{
// Show sheet and get the camera controller from the selection.
string selectedCamera =
await DisplayActionSheet("Select camera controller", "Cancel", null, _controllers);
await Application.Current.Windows[0].Page.DisplayActionSheet("Select camera controller", "Cancel", null, _controllers);

// If selected cancel then do nothing.
if (selectedCamera == "Cancel") return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ private async void SuggestionButtonTapped(object sender, System.EventArgs e)
try
{
// Display the list of suggestions; returns the selected option
string action = await DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);
string action = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);

if (action == "Cancel")
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ private async void SuggestionButtonTapped(object sender, System.EventArgs e)
try
{
// Display the list of suggestions; returns the selected option
string action = await DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);
string action = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);
// Update the search
MySearchBar.Text = action;
_ = UpdateSearchAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private async Task<UtilityTerminal> GetTerminalAsync(IEnumerable<UtilityTerminal
{
// Load the terminals into a DisplayActionSheet and await the user's selection.
var terminalArray = terminals.Select(x => x.Name).ToArray();
string choice = await DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
if (terminalArray.Contains(choice))
{
return terminals.Single(x => x.Name == choice);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ private async Task<UtilityTerminal> WaitForTerminal(IEnumerable<UtilityTerminal>
{
// Load the terminals into a DisplayActionSheet and await the user's selection.
var terminalArray = terminals.Select(x => x.Name).ToArray();
string choice = await DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
if (terminalArray.Contains(choice))
{
return terminals.Single(x => x.Name == choice);
Expand Down Expand Up @@ -314,7 +314,7 @@ private async void TraceTypeButtonPressed(object sender, EventArgs e)
{
// Prompt the user to select a type of trace.
var traceTypes = new string[] { "Connected", "Subnetwork", "Upstream", "Downstream" };
string choice = await DisplayActionSheet("Choose type of trace", "Cancel", null, traceTypes);
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose type of trace", "Cancel", null, traceTypes);

// Set the selected trace type.
_selectedTraceType = (UtilityTraceType)Enum.Parse(typeof(UtilityTraceType), choice);
Expand Down
2 changes: 1 addition & 1 deletion src/MAUI/Maui.Samples/Views/SamplePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ private ToolbarItem PrepareScreenshotTool()

private async void VerticalHandle_Clicked(object sender, EventArgs e)
{
await DisplayActionSheet("", "Cancel", null, [LiveSample, Description, SourceCode, ViewOnGitHub, BugReport, FeatureRequest]).ContinueWith((result) =>
await Application.Current.Windows[0].Page.DisplayActionSheet("", "Cancel", null, [LiveSample, Description, SourceCode, ViewOnGitHub, BugReport, FeatureRequest]).ContinueWith((result) =>
{
if (result.Result != "Cancel")
{
Expand Down
Loading