当前位置: 首页>>代码示例>>C#>>正文


C# IDialogService.ShowGenericServiceErrorNotification方法代码示例

本文整理汇总了C#中IDialogService.ShowGenericServiceErrorNotification方法的典型用法代码示例。如果您正苦于以下问题:C# IDialogService.ShowGenericServiceErrorNotification方法的具体用法?C# IDialogService.ShowGenericServiceErrorNotification怎么用?C# IDialogService.ShowGenericServiceErrorNotification使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IDialogService的用法示例。


在下文中一共展示了IDialogService.ShowGenericServiceErrorNotification方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ProfileViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="ProfileViewModel" /> class.
        /// </summary>
        /// <param name="navigationFacade">The navigation facade.</param>
        /// <param name="photoService">The photo service.</param>
        /// <param name="dialogService">The dialog service.</param>
        public ProfileViewModel(INavigationFacade navigationFacade, IPhotoService photoService,
            IDialogService dialogService)
        {
            _navigationFacade = navigationFacade;
            _photoService = photoService;
            _dialogService = dialogService;

            Photos = new IncrementalLoadingCollection<Photo>(s =>
            {
                Func<Task<PagedResponse<Photo>>> f = async () =>
                {
                    if (IsShowingCurrentUser)
                    {
                        var stream = await photoService.GetPhotosForCurrentUser(s);
                        return stream;
                    }

                    return await photoService.GetPhotosForUser(User, s);
                };
                return f();
            }, async () => await _dialogService.ShowGenericServiceErrorNotification(),
                OnPhotosLoadingFinished);

            // Photos collection is being loaded asynchronously, so we need to
            // watch it to see if the user has any pictures uploaded already.
            Photos.CollectionChanged += PhotosCollectionChanged;

            // Initialize commands
            PhotoSelectedCommand = new RelayCommand<Photo>(OnPhotoSelected);
            DeletePhotoCommand = new RelayCommand<Photo>(OnDeletePhoto);
            SetProfilePhotoCommand = new RelayCommand<Photo>(OnSetProfilePhoto);

            // Before pictures are retrieved from the service,
            // we want to prevent an initial notification showing up
            // that the user has no pictures.
            ArePhotosEmpty = false;
        }
开发者ID:Microsoft,项目名称:Appsample-Photosharing,代码行数:43,代码来源:ProfileViewModel.cs

示例2: StreamViewModel

        /// <summary>
        /// Initializes a new instance of the <see cref="StreamViewModel" /> class.
        /// </summary>
        /// <param name="navigationFacade">The navigation facade.</param>
        /// <param name="photoService">The photo service.</param>
        /// <param name="authEnforcementHandler">the authentication enforcement handler</param>
        /// <param name="dialogService">The dialog service.</param>
        public StreamViewModel(INavigationFacade navigationFacade, IPhotoService photoService,
            IAuthEnforcementHandler authEnforcementHandler, IDialogService dialogService)
        {
            _navigationFacade = navigationFacade;
            _authEnforcementHandler = authEnforcementHandler;
            _dialogService = dialogService;

            Photos = new IncrementalLoadingCollection<Photo>(s =>
            {
                Func<Task<PagedResponse<Photo>>> f = async () =>
                {
                    var stream = await photoService.GetPhotosForCategoryId(Category.Id, s);

                    if (SelectedPhotoThumbnail != null
                        && SelectedPhoto == null)
                    {
                        SelectedPhoto = stream.Items.FindPhotoForThumbnail(SelectedPhotoThumbnail);
                    }

                    return stream;
                };

                return f();
            }, async () => await _dialogService.ShowGenericServiceErrorNotification());

            // Initialize commands
            RefreshCommand = new RelayCommand(OnRefresh);
            GotoCameraCommand = new RelayCommand(OnGotoCamera);
            GiveGoldCommand = new RelayCommand<Photo>(OnGiveGold);
            PhotoSelectedCommand = new RelayCommand<Photo>(OnPhotoSelected);
            ContributeCommand = new RelayCommand(OnGotoCamera);
            UserSelectedCommand = new RelayCommand<User>(OnUserSelected);
        }
开发者ID:Microsoft,项目名称:Appsample-Photosharing,代码行数:40,代码来源:StreamViewModel.cs


注:本文中的IDialogService.ShowGenericServiceErrorNotification方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。