Now that we have our ViewModel base class set up, as well as all of the code for receiving and sending messages, it's time to create the two views. These will act as the user interface of the app.
We are going to start by creating the main view. This is the view that will be displayed when the user starts the app. We will add an entry control (an input text box) so that the user can enter a username and add a command to navigate to the chat view.
The main view will be composed of the following:
- A ViewModel file called MainViewModel.cs
- A XAML file called MainView.xaml, which contains the layout
- A code-behind file called MainView.xaml.cs, which will carry out the data binding process
Let's start by creating the ViewModel for MainView.