Skip to content

Commit b0a18b9

Browse files
Fixes displayactionsheet (#1572)
1 parent e837827 commit b0a18b9

11 files changed

Lines changed: 14 additions & 14 deletions

File tree

src/MAUI/Maui.Samples/Samples/Data/GeodatabaseTransactions/GeodatabaseTransactions.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private async void StopEditTransaction(object sender, EventArgs e)
275275
try
276276
{
277277
// Ask the user if they want to commit or rollback the transaction (or cancel to keep working in the transaction).
278-
string choice = await DisplayActionSheet("Transaction", "Cancel", null, "Commit", "Rollback");
278+
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Transaction", "Cancel", null, "Commit", "Rollback");
279279

280280
if (choice == "Commit")
281281
{

src/MAUI/Maui.Samples/Samples/Layers/RasterRenderingRule/RasterRenderingRule.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private async Task ChangeRenderingRuleAsync()
9595
try
9696
{
9797
// Display a picker to the user to choose among the available rendering rules for the image service raster
98-
string myRenderingRuleInfoName = await DisplayActionSheet("Select a Rendering Rule", "Cancel", null, _names.ToArray());
98+
string myRenderingRuleInfoName = await Application.Current.Windows[0].Page.DisplayActionSheet("Select a Rendering Rule", "Cancel", null, _names.ToArray());
9999

100100
// Loop through each rendering rule info in the image service raster
101101
foreach (RenderingRuleInfo myRenderingRuleInfo in _myReadOnlyListRenderRuleInfos)

src/MAUI/Maui.Samples/Samples/Map/AuthorMap/AuthorMap.xaml.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ private async void Basemap_Clicked(object sender, EventArgs e)
162162
{
163163
try
164164
{
165-
string selectionName = await DisplayActionSheet("Select basemap", "Cancel", null, _basemaps.Keys.ToArray());
165+
string selectionName = await Application.Current.Windows[0].Page.DisplayActionSheet("Select basemap", "Cancel", null, _basemaps.Keys.ToArray());
166166

167167
if (selectionName == "Cancel") return;
168168

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

186186
if (selectionName == "Cancel") return;
187187

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

209209
if (selectionName == "Cancel") return;
210210

src/MAUI/Maui.Samples/Samples/Map/OpenMapURL/OpenMapURL.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ private async void OnMapsClicked(object sender, EventArgs e)
4848
try
4949
{
5050
// Show sheet and get title from the selection
51-
string selectedMapTitle = await DisplayActionSheet("Select map", "Cancel", null, _titles);
51+
string selectedMapTitle = await Application.Current.Windows[0].Page.DisplayActionSheet("Select map", "Cancel", null, _titles);
5252

5353
// If selected cancel do nothing
5454
if (selectedMapTitle == null || selectedMapTitle == "Cancel") return;

src/MAUI/Maui.Samples/Samples/MapView/ChangeViewpoint/ChangeViewpoint.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private async void OnViewpointsClicked(object sender, EventArgs e)
7676
{
7777
// Show sheet and get title from the selection
7878
string selectedMapTitle =
79-
await DisplayActionSheet("Select viewpoint", "Cancel", null, titles);
79+
await Application.Current.Windows[0].Page.DisplayActionSheet("Select viewpoint", "Cancel", null, titles);
8080

8181
// If selected cancel do nothing
8282
if (selectedMapTitle == "Cancel") return;

src/MAUI/Maui.Samples/Samples/SceneView/ChooseCameraController/ChooseCameraController.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ private async void OnButtonClicked(object sender, EventArgs e)
135135
{
136136
// Show sheet and get the camera controller from the selection.
137137
string selectedCamera =
138-
await DisplayActionSheet("Select camera controller", "Cancel", null, _controllers);
138+
await Application.Current.Windows[0].Page.DisplayActionSheet("Select camera controller", "Cancel", null, _controllers);
139139

140140
// If selected cancel then do nothing.
141141
if (selectedCamera == "Cancel") return;

src/MAUI/Maui.Samples/Samples/Search/FindAddress/FindAddress.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ private async void SuggestionButtonTapped(object sender, System.EventArgs e)
152152
try
153153
{
154154
// Display the list of suggestions; returns the selected option
155-
string action = await DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);
155+
string action = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);
156156

157157
if (action == "Cancel")
158158
{

src/MAUI/Maui.Samples/Samples/Search/OfflineGeocode/OfflineGeocode.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ private async void SuggestionButtonTapped(object sender, System.EventArgs e)
163163
try
164164
{
165165
// Display the list of suggestions; returns the selected option
166-
string action = await DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);
166+
string action = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose an address to geocode", "Cancel", null, _addresses);
167167
// Update the search
168168
MySearchBar.Text = action;
169169
_ = UpdateSearchAsync();

src/MAUI/Maui.Samples/Samples/UtilityNetwork/PerformValveIsolationTrace/PerformValveIsolationTrace.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ private async Task<UtilityTerminal> GetTerminalAsync(IEnumerable<UtilityTerminal
209209
{
210210
// Load the terminals into a DisplayActionSheet and await the user's selection.
211211
var terminalArray = terminals.Select(x => x.Name).ToArray();
212-
string choice = await DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
212+
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
213213
if (terminalArray.Contains(choice))
214214
{
215215
return terminals.Single(x => x.Name == choice);

src/MAUI/Maui.Samples/Samples/UtilityNetwork/TraceUtilityNetwork/TraceUtilityNetwork.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ private async Task<UtilityTerminal> WaitForTerminal(IEnumerable<UtilityTerminal>
222222
{
223223
// Load the terminals into a DisplayActionSheet and await the user's selection.
224224
var terminalArray = terminals.Select(x => x.Name).ToArray();
225-
string choice = await DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
225+
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose junction.", "Cancel", null, terminalArray);
226226
if (terminalArray.Contains(choice))
227227
{
228228
return terminals.Single(x => x.Name == choice);
@@ -314,7 +314,7 @@ private async void TraceTypeButtonPressed(object sender, EventArgs e)
314314
{
315315
// Prompt the user to select a type of trace.
316316
var traceTypes = new string[] { "Connected", "Subnetwork", "Upstream", "Downstream" };
317-
string choice = await DisplayActionSheet("Choose type of trace", "Cancel", null, traceTypes);
317+
string choice = await Application.Current.Windows[0].Page.DisplayActionSheet("Choose type of trace", "Cancel", null, traceTypes);
318318

319319
// Set the selected trace type.
320320
_selectedTraceType = (UtilityTraceType)Enum.Parse(typeof(UtilityTraceType), choice);

0 commit comments

Comments
 (0)