Xamarin Forms.Xaml.XamlParseException

前端 未结 5 1409
长发绾君心
长发绾君心 2021-01-26 00:30

I am creating a xamarin behaviour to validate an email id, therefore I created the behaviour file and tried to localise it in XAML file but I get the below error

5条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-26 00:57

    For the import to work, the class EmailBhvr must

    1. be named "EmailBhvr"
    2. reside in an assembly with an assembly name "Validation".
    3. reside in the namespace "Validation" (check your class file)

    Be especially careful with 2.: If you use a shared Project the assembly name will be that of the platform project (e.g. it could be Validation.Droid / Validation.iOS). That can be fixed be giving both the same Assembly name (in project properties). For example "Validation.Platform" and change the xaml namespace import accordingly

提交回复
热议问题