public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (!(value is int channelCenterFrequencyInKilohertz)) { return("-/-"); } return($"{WiFi.ConvertChannelFrequencyToGigahertz(channelCenterFrequencyInKilohertz)} GHz"); }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (!(value is WiFiNetworkInfo info)) { return("-/-"); } double ghz = WiFi.ConvertChannelFrequencyToGigahertz(info.ChannelCenterFrequencyInKilohertz) > 5 ? 5 : 2.4; return($"{ghz} GHz / Channel {WiFi.GetChannelFromChannelFrequency(info.ChannelCenterFrequencyInKilohertz)} ({info.NetworkRssiInDecibelMilliwatts} dBm)"); }