In my solution I have set the default value for list like below code
<ListBox x:Name="SelectorList"
ItemsSource="{Binding ViewStatusList}"
SelectedItem="{Binding SelectedDeviceItem,Mode=TwoWay}"
IsSynchronizedWithCurrentItem="True">
create the property for SelectedDeviceItem in my view model.
private Device _selecteddeviceitem;
public Device SelectedDeviceItem
{
get
{
return _selecteddeviceitem;
}
set
{
_selecteddeviceitem = value;
OnPropertyChanged("SelectedDeviceItem");
}
}
and passed SelectedDeviceItem = StatusList[0];
in the constructor.
But still my listbox will be shown like below.
But I need the result should be like below image
What have I missed in the this list box code?