Here, we will learn how to write C# code in WPF XAML.

Step 1 Create WPF Window

Step 2 Messagebox popup on button click.

That’s it. We are done. Try it yourself and see the result.