16
16
#endif
17
17
18
18
using ArcGIS . Samples . Managers ;
19
+ using ArcGIS . Helpers ;
19
20
using ArcGIS . Samples . Shared . Models ;
20
21
using CommunityToolkit . Maui . Views ;
21
22
using Esri . ArcGISRuntime . Maui ;
@@ -46,6 +47,8 @@ public partial class SamplePage : ContentPage
46
47
public ObservableCollection < SourceCodeFile > SourceFiles { get ; } = new ObservableCollection < SourceCodeFile > ( ) ;
47
48
48
49
// Toolbar item titles as displayed in UI
50
+ private const string BugReport = "Open a Bug Report" ;
51
+ private const string FeatureRequest = "Request a Feature" ;
49
52
private const string ViewOnGitHub = "View on GitHub" ;
50
53
private const string SourceCode = "Source Code" ;
51
54
private const string Description = "Description" ;
@@ -337,13 +340,6 @@ protected override bool OnBackButtonPressed()
337
340
338
341
private void SetToolbarItems ( )
339
342
{
340
- // Feedback toolbar item should be placed last on desktop and first on mobile.
341
- var feedbackToolbarItem = new ToolbarItem
342
- {
343
- IconImageSource = "feedback.png" ,
344
- Text = "Feedback"
345
- } ;
346
- feedbackToolbarItem . Clicked += FeedbackToolbarItem_Clicked ;
347
343
348
344
#if WINDOWS
349
345
// Add the screenshot tool if enabled in settings.
@@ -385,17 +381,23 @@ private void SetToolbarItems()
385
381
gitHubToolbarItem . Clicked += GitHubToolbarItem_Clicked ;
386
382
ToolbarItems . Add ( gitHubToolbarItem ) ;
387
383
384
+ // Feedback toolbar item should only be present on desktop platforms.
385
+ var feedbackToolbarItem = new ToolbarItem
386
+ {
387
+ IconImageSource = "feedback.png" ,
388
+ Text = "Feedback"
389
+ } ;
390
+ feedbackToolbarItem . Clicked += FeedbackToolbarItem_Clicked ;
388
391
ToolbarItems . Add ( feedbackToolbarItem ) ;
392
+ // On mobile platforms, issue forms are accessible via the vertical handle.
389
393
#else
390
- ToolbarItems . Add ( feedbackToolbarItem ) ;
391
394
var verticalHandle = new ToolbarItem
392
395
{
393
396
IconImageSource = "verticalhandle.png"
394
397
} ;
395
398
verticalHandle . Clicked += VerticalHandle_Clicked ;
396
399
ToolbarItems . Add ( verticalHandle ) ;
397
400
#endif
398
-
399
401
}
400
402
401
403
#if WINDOWS
@@ -417,7 +419,7 @@ private ToolbarItem PrepareScreenshotTool()
417
419
418
420
private async void VerticalHandle_Clicked ( object sender , EventArgs e )
419
421
{
420
- await DisplayActionSheet ( "Select a view " , "Cancel" , null , new string [ ] { LiveSample , Description , SourceCode , ViewOnGitHub } ) . ContinueWith ( ( result ) =>
422
+ await DisplayActionSheet ( "" , "Cancel" , null , [ LiveSample , Description , SourceCode , ViewOnGitHub , BugReport , FeatureRequest ] ) . ContinueWith ( ( result ) =>
421
423
{
422
424
if ( result . Result != "Cancel" )
423
425
{
@@ -438,6 +440,14 @@ private async void VerticalHandle_Clicked(object sender, EventArgs e)
438
440
case ViewOnGitHub :
439
441
_ = OpenGitHub ( ) ;
440
442
break ;
443
+
444
+ case BugReport :
445
+ FeedbackPrompt . OpenBugReport ( ) ;
446
+ break ;
447
+
448
+ case FeatureRequest :
449
+ FeedbackPrompt . OpenFeatureRequest ( ) ;
450
+ break ;
441
451
}
442
452
}
443
453
} , TaskScheduler . FromCurrentSynchronizationContext ( ) ) ;
0 commit comments