public App() { // The root page of your application ILocalNotifications localNotifications = DependencyService.Get <ILocalNotifications>(); Button showNotificationButton = new Button(); showNotificationButton.Text = "Show Local Notification"; showNotificationButton.Clicked += (sender, e) => localNotifications.Show("Test", "Local notification alert", 1); Button cancelNotificationButton = new Button(); cancelNotificationButton.Text = "Cancel Local Notification"; cancelNotificationButton.Clicked += (sender, e) => localNotifications.Cancel(1); MainPage = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, Children = { showNotificationButton, cancelNotificationButton } } }; }
public App() { //pokazuje na pasku ILocalNotifications localNotifications = DependencyService.Get <ILocalNotifications>(); Button showNotificationButton = new Button(); showNotificationButton.Text = "Pokaż lokalne powiadomienia"; showNotificationButton.Clicked += (sender, e) => localNotifications.Show("Test", "Lokalne powiadomienie", 1); Button cancelNotificationButton = new Button(); cancelNotificationButton.Text = "Przerwij lokalne powiadomienia"; cancelNotificationButton.Clicked += (sender, e) => localNotifications.Cancel(1); MainPage = new ContentPage { Content = new StackLayout { VerticalOptions = LayoutOptions.Center, Children = { showNotificationButton, cancelNotificationButton } } }; }