XLabs AutoCompleteView + Selected Item

EduardoMelloEduardoMello USMember

Hello,

I try to set selected item by code, but is not work.

<xcontrols:AutoCompleteView x:Name="autoCompleteCities" Placeholder="Cidade - UF" 
    SelectedItem="{Binding SelectedItem}"
    ShowSearchButton="False"
    SuggestionItemDataTemplate="{StaticResource SugestionItemTemplate}"
----Text="{Binding SelectedItemText}"
----Grid.Row="3" Grid.Column="1"/>

SelectedItem = Items.FirstOrDefault(p => p.NrSeqCidade == prospect.NrSeqCidade);

public CityModel SelectedItem { 
    get { return _selectedItem; } 
    set { 
        SetProperty(ref _selectedItem, value); 
        Prospect.NrSeqCidade = _selectedItem == null ? 0 : selectedItem.NrSeqCidade; 
        SelectedItemText = _selectedItem == null ? "" : _selectedItem.FullName; 
    }
} 

how can i show the selected item by code behind ?

Sign In or Register to comment.