diff --git a/src/TeamsISO.App/Assets/Fonts/JetBrainsMono.ttf b/src/TeamsISO.App/Assets/Fonts/JetBrainsMono.ttf new file mode 100644 index 0000000..b60e77f Binary files /dev/null and b/src/TeamsISO.App/Assets/Fonts/JetBrainsMono.ttf differ diff --git a/src/TeamsISO.App/Converters/CountToVisibilityConverter.cs b/src/TeamsISO.App/Converters/CountToVisibilityConverter.cs new file mode 100644 index 0000000..dae52e0 --- /dev/null +++ b/src/TeamsISO.App/Converters/CountToVisibilityConverter.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Globalization; +using System.Windows; +using System.Windows.Data; + +namespace TeamsISO.App.Converters; + +/// +/// Maps a collection (or its count) to . Pass +/// "empty" as the converter parameter to invert the sense (Visible when +/// count == 0). Used to swap an empty-state placeholder in for the participants +/// DataGrid when no Teams sources are visible yet. +/// +public sealed class CountToVisibilityConverter : IValueConverter +{ + public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture) + { + var count = value switch + { + int n => n, + ICollection c => c.Count, + null => 0, + _ => 1, // anything else: treat as non-empty + }; + var invert = string.Equals(parameter as string, "empty", StringComparison.OrdinalIgnoreCase); + var visible = invert ? count == 0 : count > 0; + return visible ? Visibility.Visible : Visibility.Collapsed; + } + + public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) => + throw new NotSupportedException(); +} diff --git a/src/TeamsISO.App/MainWindow.xaml b/src/TeamsISO.App/MainWindow.xaml index e8fd153..4a1fae8 100644 --- a/src/TeamsISO.App/MainWindow.xaml +++ b/src/TeamsISO.App/MainWindow.xaml @@ -35,6 +35,7 @@ + @@ -352,8 +353,77 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -424,7 +494,8 @@ + VerticalAlignment="Center" + ToolTip="Override the auto-generated NDI output name (TEAMSISO_xxxxxxxx). Takes effect when ISO is enabled."/> @@ -433,7 +504,8 @@