UI polish: YouTube status light, Go Live/Stop Stream buttons with working visibility
This commit is contained in:
+29
-7
@@ -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}"
|
|
||||||
|
<!-- YouTube connection status light + button -->
|
||||||
|
<Border Background="#0f3460" CornerRadius="4" Padding="8,6" Margin="0,0,12,0"
|
||||||
|
VerticalAlignment="Center" ToolTip="YouTube connection status">
|
||||||
|
<StackPanel Orientation="Horizontal">
|
||||||
|
<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}"
|
||||||
|
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}"
|
Command="{Binding StartStreamCommand}"
|
||||||
Visibility="{Binding StreamStatus, Converter={StaticResource BoolToVis},
|
Visibility="{Binding IsOffline, Converter={StaticResource BoolToVis}}"/>
|
||||||
ConverterParameter=Offline}"/>
|
<Button Content="Stop Stream" Style="{StaticResource YtButton}"
|
||||||
<Button Content="■ STOP" Style="{StaticResource YtButton}"
|
Background="#333" Command="{Binding StopStreamCommand}"
|
||||||
Background="#333" Command="{Binding StopStreamCommand}"/>
|
Visibility="{Binding IsLive, Converter={StaticResource BoolToVis}}"/>
|
||||||
<Button Content="YouTube" Style="{StaticResource YtButtonSecondary}"
|
|
||||||
Command="{Binding ConnectYouTubeCommand}" Margin="8,0,0,0"/>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -31,9 +31,20 @@ 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
|
||||||
{
|
{
|
||||||
get => _currentHealth;
|
get => _currentHealth;
|
||||||
|
|||||||
Reference in New Issue
Block a user