Caliburn-Micro / Caliburn.Micro

A small, yet powerful framework, designed for building applications across all XAML platforms. Its strong support for MV* patterns will enable you to build your solution quickly, without the need to sacrifice code quality or testability.
http://caliburnmicro.com/
MIT License
2.79k stars 776 forks source link

Do not call InitializeComponent for Avalonia. #849

Closed Stannieman closed 1 year ago

Stannieman commented 1 year ago

My fix from before should be removed. According to danwalmsley we don't need to call it, the default constructor of a control will do it for us. And if a user decides to use a non-default constructor then it is his responsibility to do it at the right moment. He added the || AVALONIA on line 510 for that reason.

Stannieman commented 1 year ago

Hmm crap maybe it is actually needed, checking with Avalonia

EDIT: Yeah so it is broken currently. Seems like InitializeComponent is not called implicitly when views are created by Caliburn, at least not in my case. It works if I keep my version and remove the || AVALONIA. I wonder if it has to do with the way views are instantiated in IOC container. So maybe wait with merge until this is fully cleared out.