What do I need to further qualify the DataContext for a binding?

前端 未结 2 903
你的背包
你的背包 2020-12-15 17:46

The files I have created and will be referring to in this question are:

TechnicainSelectionView.xaml
TechnicianSelectionView.cs
TechnicianSelectionViewModel.         


        
2条回答
  •  暖寄归人
    2020-12-15 18:45

    In my Xamarin Forms Xaml file I used the following lines in the header (ContentPage tag) and it worked perfectly as I wanted.

    Basically now

    • the intellisense shows the fields in the binding
    • my Resharper is able to rename the binding in the Xaml file if I refactor the name of the property

      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:vm="clr-namespace:YourApplicationName.ViewModels;assembly=YourApplicationName"
      mc:Ignorable="d"
      d:DataContext="{d:DesignInstance {x:Type vm:CurrentPageViewModel}}"
      

提交回复
热议问题