Snapping to my current calibration lead without binding agreement

in caliburn, when I work with the binding convention, and name the content control "CurrentPresenter" the structure automatically binds to vm and finds the appropriate view.

if I do this snapping manually, the view is not found. how can I achieve this ability without a binding agreement (my opinion is a user control)

+3
source share
1 answer

You need to bind the View.Model property, which:

  • displays the correct view for representing VM
  • binds a DataContext view to a VM
  • invokes a view in the ContentControl Content property

Example:

<!-- Caliburn v1.x -->
<ContentControl cal:View.Model="{Binding CurrentPresenter}" />

Caliburn v1.x, Caliburn v2 Caliburn.Micro IPresesenterManager IConductor ( ), :

<!-- Caliburn v2 & Caliburn.Micro -->
<ContentControl cal:View.Model="{Binding ActiveItem}" />
+9

Source: https://habr.com/ru/post/1762136/


All Articles