C# – WPF – Application with two click buttons and two radio buttons

In this article I present a simple application with two buttons and two radio buttons. The idea is the following – each one of the two click buttons run a WAV file from the Windows ones. The radio buttons are used, to change the font of the click buttons.

What is interesting here – the colors are not explicitly written in the XAML code, but their values are defined in the code and are accessed as variables. The colors, defined in the XAML code may be also accessed from the C# code, with the “Find Resource” option:

The above example is not exactly a good practice for coding, as far as a=b=c is not advisable from aesthetic point of view, but as far we now the way it runs (making “a” and “b” equal to “c”), it is OK for this example.

This is a screenshot of the application:
2songs

 

Below is the XAML code, used to build it: 

Here comes the code from the C# part of the WPF:

If you are willing to try this outstanding application ( 🙂 ), you may download it from here. If you are using Windows, you may receive the following message, while trying to download the application:

Keep

In stead of selecting “Report & Discard”, you should try with the “Keep” option in order to keep the application. The ZIP files contains the exe file + the two WAV files.

Enjoy it!