0
我有一些問題,在數據綁定微卡利的ViewModels,我都有以下代碼:Caliburn.Micro - 數據綁定contentpresenter到視圖模型
<ContentControl Content="{Binding PaymentDetails}">
<ContentControl.Template>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Controls:RoundedBox/>
<ContentPresenter Content="{Binding PaymentDetails}" Margin="10,0,10,0"/>
</Grid>
</ControlTemplate>
</ContentControl.Template>
</ContentControl>
的問題是,PaymentDetails是一個視圖模型,雖然數據綁定一個簡單的ContentControl使用caliburn micros命名約定來查找視圖,使用模板和contentpresenter時,視圖模型綁定僅顯示視圖模型的字符串表示形式,而不是查找視圖。我不是這類事情的專家,我也沒有在google上找到答案。
我想要的是在使用模板時,讓viewmodel綁定自動查找像往常一樣的視圖,但我想我在這裏錯過了一些理解。
是的,這非常完美!謝謝。 – Ben