Created
July 22, 2024 07:48
-
-
Save syaifulnizamyahya/ad99fac77eddf0bd0164160388f731d9 to your computer and use it in GitHub Desktop.
WPF MVVM Toolkit add new button with command
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
| in xaml | |
| <Button Content="Generate key" Command="{Binding GenerateKeyCommand}"/> | |
| in viewmodel | |
| private RelayCommand generateKeyCommand; | |
| public ICommand GenerateKeyCommand => generateKeyCommand ??= new RelayCommand(GenerateKey); | |
| private void GenerateKey() | |
| { | |
| MessageBox.Show("GenerateKey"); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment