I am working with an app in Xamarin, but I want to make sure I am doing everything correctly as I go along. I have a `Dialpad` control that I display in `MainPage` through `<ctrl:Dialpad x:Name="dialpad" HeightRequest="600"/>`. `MainPage` has a `BindingContext` of `MainPageViewModel` and `Dialpad` has one of `DialpadViewModel`. I have an event in `DialpadViewModel` that gets called whenever a number key is pressed on the dialpad. For simplicity's sake, these buttons are meant to update a label on `MainPage`. In order to do this, I have this code in the code-behind file of `MainPage.xaml.cs`.

```
public MainPage()
    {
        InitializeComponent();

        //add an event handler for a button pressed
        InitializeEvents();

    }

    void InitializeEvents ()
    {
        //whenever the keypad is pressed
        ((DialpadViewModel)dialpad.BindingContext).OnKeyPressed += ((MainPageViewModel)BindingContext).DialpadButtonPressed;
        ((DialpadViewModel)dialpad.BindingContext).OnDial += ((MainPageViewModel)BindingContext).DialAddress;
        ((DialpadViewModel)dialpad.BindingContext).OnBackspace += ((MainPageViewModel)BindingContext).Backspace;
    }

```

I know, that according to the MVVM format, there is supposed to be NO code in the code-behind file. However, I have no idea how to approach this otherwise. Any advice?