// 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);

            StatusBannersSource.Remove(itemToDismiss);
        }
Exemple #2
0
        // 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);
        }
        /// <summary>
        /// Posts a new banner with expanded height to the Status Center control. This is typically
        /// used to represent a failure during a prior operation which must be acted upon.
        /// </summary>
        /// <param name="title"></param>
        /// <param name="message"></param>
        /// <param name="primaryButtonText"></param>
        /// <param name="cancelButtonText"></param>
        /// <param name="primaryAction"></param>
        /// <returns>A StatusBanner object which may be used to automatically remove the banner from UI.</returns>
        public PostedStatusBanner PostActionBanner(string title, string message, string primaryButtonText, string cancelButtonText, Action primaryAction)
        {
            StatusBanner item = new StatusBanner(message, title, primaryButtonText, cancelButtonText, primaryAction);

            StatusBannersSource.Add(item);
            return(new PostedStatusBanner(item));
        }
        public StatusBanner PostBanner(string title, string message, uint initialProgress, StatusBanner.StatusBannerSeverity severity, StatusBanner.StatusBannerOperation operation)
        {
            var item = new StatusBanner(message, title, initialProgress, severity, operation);

            StatusBannersSource.Add(item);
            return(item);
        }
        /// <summary>
        /// Posts a new banner to the Status Center control for an operation.
        /// It may be used to return the progress, success, or failure of the respective operation.
        /// </summary>
        /// <param name="title">Reserved for success and error banners. Otherwise, pass an empty string for this argument.</param>
        /// <param name="message"></param>
        /// <param name="initialProgress"></param>
        /// <param name="status"></param>
        /// <param name="operation"></param>
        /// <returns>A StatusBanner object which may be used to track/update the progress of an operation.</returns>
        public PostedStatusBanner PostBanner(string title, string message, float initialProgress, ReturnResult status, FileOperationType operation)
        {
            StatusBanner item = new StatusBanner(message, title, initialProgress, status, operation);

            StatusBannersSource.Add(item);
            ProgressBannerPosted?.Invoke(this, EventArgs.Empty);
            return(new PostedStatusBanner(item));
        }
Exemple #6
0
        /// <summary>
        /// Posts a new banner to the Status Center control for an operation.
        /// It may be used to return the progress, success, or failure of the respective operation.
        /// </summary>
        /// <param name="title">Reserved for success and error banners. Otherwise, pass an empty string for this argument.</param>
        /// <param name="message"></param>
        /// <param name="initialProgress"></param>
        /// <param name="severity"></param>
        /// <param name="operation"></param>
        /// <returns>A StatusBanner object which may be used to track/update the progress of an operation.</returns>
        public PostedStatusBanner PostBanner(string title, string message, uint initialProgress, StatusBanner.StatusBannerSeverity severity, StatusBanner.StatusBannerOperation operation)
        {
            var item = new StatusBanner(message, title, initialProgress, severity, operation);

            StatusBannersSource.Add(item);
            ProgressBannerPosted?.Invoke(this, EventArgs.Empty);
            return(new PostedStatusBanner(item));
        }
Exemple #7
0
        // Dismiss banner button event handler
        private void DismissBanner(object sender, RoutedEventArgs e)
        {
            StatusBanner itemToDismiss = (sender as Button).DataContext as StatusBanner;

            OngoingTasksViewModel.CloseBanner(itemToDismiss);
        }
 public PostedStatusBanner(StatusBanner bannerArg)
 {
     Banner    = bannerArg;
     Progress  = new Progress <float>(ReportProgressToBanner);
     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;

            StatusBannersSource.Remove(itemToDismiss);
        }
 public void RemoveBanner(StatusBanner banner)
 {
     StatusBannersSource.Remove(banner);
 }
Exemple #11
0
 public PostedStatusBanner(StatusBanner bannerArg)
 {
     Banner   = bannerArg;
     Progress = new Progress <uint>(ReportProgressToBanner);
 }