Sometimes when I view a certain window with a ComboBox, the box appears as follows:
Why does it appear with this red outline sometimes? Is there any way for me to get information on what is going on in the background when this occurs?
The ComboBox is defined as:
<ComboBox Grid.Column="1" Grid.Row="1" Name="cbConnectMethod"
ItemsSource="{Binding ConnectMethodList}"
SelectedItem="{Binding SelectedConnectionMethod}"
DisplayMemberPath="Description" VerticalAlignment="Center"
Width="Auto" HorizontalAlignment="Left" />
And the properties for ItemSource
and SelectedItem
are defined as:
public class ConnectMethod
{
public Connection Method { get; set; }
public string Description { get; set; }
}
public List<ConnectMethod> ConnectMethodList { get; set; }
public ConnectMethod SelectedConnectionMethod
{
get
{
return ConnectMethodList.FirstOrDefault(xx => xx.Method == _dataContainer.ConnectionData.Connection);
}
set
{
if (_dataContainer.ConnectionData.Connection != value.Method)
{
_dataContainer.ConnectionData.Connection = value.Method;
updateConnectDetailPage();
}
}
}
Connection
is just an enum, defined as:
public enum Connection
{
USB = 4,
Serial = 1,
Modem = 3,
SomethingElse = 2,
IP = 5,
AnotherThing = 6,
}