UI polish: YouTube status light, Go Live/Stop Stream buttons with working visibility

This commit is contained in:
2026-08-04 10:32:04 -07:00
parent d4945f4fd0
commit 8ee44f571e
2 changed files with 41 additions and 8 deletions
+29 -7
View File
@@ -121,14 +121,36 @@
<!-- Stream Controls --> <!-- Stream Controls -->
<StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center"> <StackPanel Grid.Column="3" Orientation="Horizontal" VerticalAlignment="Center">
<Button Content="▶ GO LIVE" Style="{StaticResource YtButton}"
Command="{Binding StartStreamCommand}" <!-- YouTube connection status light + button -->
Visibility="{Binding StreamStatus, Converter={StaticResource BoolToVis}, <Border Background="#0f3460" CornerRadius="4" Padding="8,6" Margin="0,0,12,0"
ConverterParameter=Offline}"/> VerticalAlignment="Center" ToolTip="YouTube connection status">
<Button Content="■ STOP" Style="{StaticResource YtButton}" <StackPanel Orientation="Horizontal">
Background="#333" Command="{Binding StopStreamCommand}"/> <Ellipse Width="10" Height="10" Margin="0,0,8,0" VerticalAlignment="Center">
<Ellipse.Style>
<Style TargetType="Ellipse">
<Setter Property="Fill" Value="#555"/>
<Style.Triggers>
<DataTrigger Binding="{Binding IsYouTubeConnected}" Value="True">
<Setter Property="Fill" Value="#00ff00"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
<Button Content="YouTube" Style="{StaticResource YtButtonSecondary}" <Button Content="YouTube" Style="{StaticResource YtButtonSecondary}"
Command="{Binding ConnectYouTubeCommand}" Margin="8,0,0,0"/> Background="Transparent" Padding="0"
Command="{Binding ConnectYouTubeCommand}"
ToolTip="Sign in to YouTube (optional)"/>
</StackPanel>
</Border>
<Button Content="Go Live" Style="{StaticResource YtButton}"
Command="{Binding StartStreamCommand}"
Visibility="{Binding IsOffline, Converter={StaticResource BoolToVis}}"/>
<Button Content="Stop Stream" Style="{StaticResource YtButton}"
Background="#333" Command="{Binding StopStreamCommand}"
Visibility="{Binding IsLive, Converter={StaticResource BoolToVis}}"/>
</StackPanel> </StackPanel>
</Grid> </Grid>
</Border> </Border>
+12 -1
View File
@@ -31,8 +31,19 @@ public class MainViewModel : ViewModelBase
public StreamStatus StreamStatus public StreamStatus StreamStatus
{ {
get => _streamStatus; get => _streamStatus;
set => SetProperty(ref _streamStatus, value); set
{
if (SetProperty(ref _streamStatus, value))
{
OnPropertyChanged(nameof(IsOffline));
OnPropertyChanged(nameof(IsLive));
OnPropertyChanged(nameof(StatusDisplay));
} }
}
}
public bool IsOffline => StreamStatus == StreamStatus.Offline;
public bool IsLive => StreamStatus == StreamStatus.Streaming;
public StreamHealth CurrentHealth public StreamHealth CurrentHealth
{ {