Skip to content

Instantly share code, notes, and snippets.

@jasondown
Created August 3, 2021 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasondown/f8af98d986d4ad9f6b3d94f9ae5caa54 to your computer and use it in GitHub Desktop.
Save jasondown/f8af98d986d4ad9f6b3d94f9ae5caa54 to your computer and use it in GitHub Desktop.
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