// Primary action button click private async void Button_Click_1(object sender, RoutedEventArgs e) { StatusBanner itemToDismiss = (sender as Button).DataContext as StatusBanner; await Task.Run(itemToDismiss.PrimaryButtonClick); OngoingTasksViewModel.CloseBanner(itemToDismiss); }
public PostedStatusBanner(StatusBanner banner, IOngoingTasksActions OngoingTasksActions) { this.Banner = banner; this.OngoingTasksActions = OngoingTasksActions; this.Progress = new Progress <float>(ReportProgressToBanner); this.ErrorCode = new Progress <FileSystemStatusCode>((errorCode) => ReportProgressToBanner(errorCode.ToStatus())); }
public PostedStatusBanner(StatusBanner banner, IStatusCenterActions statusCenterActions) { this.Banner = banner; this.statusCenterActions = statusCenterActions; this.Progress = new Progress <float>(ReportProgressToBanner); this.ErrorCode = new Progress <FileSystemStatusCode>((errorCode) => ReportProgressToBanner(errorCode.ToStatus())); }
// Dismiss banner button event handler private void DismissBanner(object sender, RoutedEventArgs e) { StatusBanner itemToDismiss = (sender as Button).DataContext as StatusBanner; OngoingTasksViewModel.CloseBanner(itemToDismiss); }