ビューモデルは通常、それが実装IViewAware
であると想定することから継承しますIScreen
Screenをキャストし、メソッドをIViewAware
使用してビューへの参照を取得できます。GetView()
独自のビューモデルに実装できIViewAware
、Caliburnが自動的にViewAttached
イベントを発生させるので、ビューへの参照を維持できると思いますが、ドキュメントを見るかもしれません。
結論:IViewAwareインターフェースを確認してください
編集:
ドキュメントから...
IViewAware – Implemented by classes which need to be made aware of the view that they are bound to. It has an AttachView method which is called by the framework when it binds the view to the instance. It has a GetView method which the framework calls before creating a view for the instance. This enables caching of complex views or even complex view resolution logic. Finally, it has an event which should be raised when a view is attached to the instance called ViewAttached.