public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { VR33BConnectionState connectionState = (VR33BConnectionState)value; if (connectionState == VR33BConnectionState.Success) { return(true); } else { return(false); } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { VR33BConnectionState connectionState = (VR33BConnectionState)value; switch (connectionState) { case VR33BConnectionState.NotConnected: return("未连接"); case VR33BConnectionState.Connecting: return("连接中"); case VR33BConnectionState.Success: return("已连接"); case VR33BConnectionState.Failed: return("连接失败"); } return("WHAT??"); }