私たちはResharperを使用しており、もちろんResharperのxamlインテリセンスを利用したいと考えています。
ビューのデータコンテキストはCurrentViewmodel
、タイプのプロパティにバインドされていますViewModelBase
。実行時に、このプロパティはから継承するビューモデルで設定されViewModelBase
ます。
正しいタイプを設定するために、ビューモデルにこれらの行をすでに追加しました。
xmlns:vms="clr-namespace:PQS.ViewModel.Report"
d:DataContext="{d:DesignInstance vms:ReportFilterViewModel, IsDesignTimeCreatable=False}"
しかし、Resharperは引き続きViewModelbase
プロパティを探し続けます。
他に何を試すことができますか?
もう少しコード:
DataContextの設定:
<UserControl.DataContext>
<Binding Path="ReportMainViewModel.CurrentVm" Source="{StaticResource Locator}"/>
</UserControl.DataContext>
何かをバインドする(ProductsはReportFilterViewmodelのプロパティであり、r#はViewModelBaseでそれを探し続けます):
<ListBox ItemsSource="{Binding Products.View}" Background="White" DisplayMemberPath="Name.ActualTranslation">
</ListBox>