mvvmcatel

Catel InitializeAsync is Not Called in ViewModel


I have an issue where every single view model that inherits from Catel.MVVM.ViewModel is never calling InitializeAsync(). What could I be missing that blocks this call?

I'm using Catel.MVVM v5.12.22.


Solution

  • The fix is to change the control type from UserControl to catel:UserControl.

    <catel:UserControl xmlns:catel="http://schemas.catelproject.com">
    

    Edit: you might want to include validation messages.

    <catel:UserControl>
        <catel:InfoBarMessageControl>
            [XAML Goes Here]
        </catel:InfoBarMessageControl>
    </catel:UserControl>