Skip to content

Instantly share code, notes, and snippets.

@maybe-joe
Created May 18, 2014 22:39
Show Gist options
  • Save maybe-joe/e3b07ff3f3b7e6e2b9da to your computer and use it in GitHub Desktop.
Save maybe-joe/e3b07ff3f3b7e6e2b9da to your computer and use it in GitHub Desktop.
An example of event handling with prism
<Button Command="{Binding Path=RaiseNotificationCommand}">Click Me</Button>
using System;
using Microsoft.Practices.Prism.Commands;
using Microsoft.Practices.Prism.Interactivity.InteractionRequest;
namespace Example
{
public class ViewModel
{
public ViewModel()
{
ButtonCommand = new DelegateCommand(ButtonCommandHandler);
}
public DelegateCommand ButtonCommand { get; private set; }
private void ButtonCommandHandler()
{
Console.WriteLine("Button Clicked");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment