Created
May 18, 2014 22:39
-
-
Save maybe-joe/e3b07ff3f3b7e6e2b9da to your computer and use it in GitHub Desktop.
An example of event handling with prism
This file contains hidden or 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
<Button Command="{Binding Path=RaiseNotificationCommand}">Click Me</Button> |
This file contains hidden or 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
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