using System;
using System.Globalization;
using System.Net.Sockets;
using System.Windows;
using System.Windows.Data;

namespace SWRIS.Converters
{
    public class ConnectivityToVisibilityConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value == null || !(value is bool isConnected))
            {
                return Visibility.Hidden;
            }
            return isConnected ? Visibility.Visible : Visibility.Hidden;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
