Created
August 3, 2021 07:24
-
-
Save jasondown/f8af98d986d4ad9f6b3d94f9ae5caa54 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 ICommand _displayLargeImage; | |
/// <summary> | |
/// Gets the command to display the large (main) image. | |
/// </summary> | |
/// <value> | |
/// The command to display the large (main) image. | |
/// </value> | |
public ICommand DisplayLargeImage | |
{ | |
get | |
{ | |
return _displayLargeImage ?? | |
(_displayLargeImage = new RelayCommand(SwitchImage)); | |
} | |
} | |
private void SwitchImage(object o) | |
{ | |
var img = o as Image; | |
if (img != null) | |
{ | |
MainImageSource = new BitmapImage(new Uri(img.Source.ToString())); | |
} | |
} | |
private BitmapImage _mainImageSource; | |
/// <summary> | |
/// Gets or sets the main image source. | |
/// </summary> | |
/// <value> | |
/// The main image source. | |
/// </value> | |
public BitmapImage MainImageSource | |
{ | |
get { return _mainImageSource; } | |
set | |
{ | |
if (!Equals(_mainImageSource, value)) | |
{ | |
_mainImageSource = value; | |
OnPropertyChanged(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment