Пример #1
0
 public App()
 {
     // The root page of your application
     MainPage = new ContentPage {
         Content = new StackLayout {
             VerticalOptions = LayoutOptions.Center,
             Children        =
             {
                 new Label  {
                     XAlign = TextAlignment.Center,
                     Text   = "Click to play a sound!"
                 },
                 new Button {
                     Text    = "Play",
                     Command = new Command(async() =>{
                         var soundService = new SoundService();
                         await soundService.PlaySoundAsync("sound.mp3");
                     })
                 }
             }
         }
     };
 }
Пример #2
0
        public App()
        {
            // The root page of your application
            MainPage = new ContentPage {
                Content = new StackLayout {
                    VerticalOptions = LayoutOptions.Center,
                    Children = {
                        new Label {
                            XAlign = TextAlignment.Center,
                            Text = "Click to play a sound!"
                        },
                        new Button{
                            Text = "Play",
                            Command = new Command(async () => {

                                var soundService = new SoundService();
                                await soundService.PlaySoundAsync("sound.mp3");
                            })
                        }
                    }
                }
            };
        }