-
-
Save jasondown/2aa9debb9f933c79bc2544995e811036 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IImageRepository _imageRepository; | |
/// <summary> | |
/// Sets the image repository. | |
/// </summary> | |
/// <param name="repository">The repository.</param> | |
/// <exception cref="System.ArgumentNullException">repository</exception> | |
[ApplicationVisible] | |
public void SetImageRepository(IImageRepository repository) | |
{ | |
if (repository == null) | |
throw new ArgumentNullException("repository"); | |
if (_imageRepository != null) | |
{ | |
_imageRepository.RequestItemImages -= OnRequestItemImages; | |
} | |
_imageRepository = repository; | |
_imageRepository.RequestItemImages += OnRequestItemImages; | |
_vm.SetImageRepository(repository); | |
} | |
/// <summary> | |
/// Occurs when a request item images is made. | |
/// </summary> | |
[ApplicationVisible] | |
public event EventHandler<ImageRequestEventArgs> RequestImages = delegate { }; | |
private void OnRequestItemImages(object sender, ImageRequestEventArgs e) | |
{ | |
RequestImages(new object(), e); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment