小编Spo*_*ior的帖子

MinOccurs 0和nillable true

在我的wsdl中,我有一个元素:

<xsd:element minOccurs="0" name="birthDate" nillable="true" type="xsd:dateTime"/>
Run Code Online (Sandbox Code Playgroud)

我知道nillable true允许空值这是否意味着它可以允许xml空标记?即

<birthDate/>
Run Code Online (Sandbox Code Playgroud)

xml xsd soap wsdl

22
推荐指数
1
解决办法
3万
查看次数

在项目源之外绑定 ViewModel 字段

嗨,我有一个绑定联系人列表的 ItemSource

<ListView  x:Name="contactsListView" ItemsSource="{Binding contacts}">
            <ListView.ItemTemplate>
                <DataTemplate>
                    <ViewCell>
                        <StackLayout Orientation="Horizontal">
                            <Image Source="{Binding Should be to my View Model instead of Contacts}"></Image>
                            <Label Text="{Binding FullName}"></Label>
                        </StackLayout>

                    </ViewCell>
                </DataTemplate>
            </ListView.ItemTemplate>
Run Code Online (Sandbox Code Playgroud)

全名绑定工作正常。我的问题是图像源不包含在联系人模型中,所以我需要从我的视图模型中检索它我该怎么做?

查看模型

    public class ContactsViewModel : INotifyPropertyChanged
{
    public ObservableCollection<Contact> contacts { get; set; }
    private string _contactImage;

    public string ContactImage
    {
        get => _contactImage; set
        {
            _contactImage = value;
            OnPropertyChanged("ContactImage");
        }
    }

    public ContactsViewModel(List<Contact> _contacts)
    {
        contacts = new ObservableCollection<Contact>(_contacts);
        ContactImage = "arrow.png";



    }

    public event PropertyChangedEventHandler PropertyChanged;
    protected virtual …
Run Code Online (Sandbox Code Playgroud)

xamarin xamarin.forms

1
推荐指数
1
解决办法
875
查看次数

标签 统计

soap ×1

wsdl ×1

xamarin ×1

xamarin.forms ×1

xml ×1

xsd ×1