本文整理汇总了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;
}
示例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);
}