diff --git a/MainWindow.xaml b/MainWindow.xaml
index ed3e4bf..9d06567 100644
--- a/MainWindow.xaml
+++ b/MainWindow.xaml
@@ -91,10 +91,17 @@
Width="400" HorizontalAlignment="Left"
VerticalAlignment="Center"/>
-
+
-
+
+
+
diff --git a/ViewModels/MainViewModel.cs b/ViewModels/MainViewModel.cs
index e84330a..9032c54 100644
--- a/ViewModels/MainViewModel.cs
+++ b/ViewModels/MainViewModel.cs
@@ -37,7 +37,7 @@ public class MainViewModel : ViewModelBase
{
OnPropertyChanged(nameof(IsOffline));
OnPropertyChanged(nameof(IsLive));
- OnPropertyChanged(nameof(PrimaryButtonText));
+ OnPropertyChanged(nameof(ShowGoLive));
}
}
}
@@ -69,24 +69,22 @@ public class MainViewModel : ViewModelBase
set
{
if (SetProperty(ref _isYouTubeConnected, value))
- OnPropertyChanged(nameof(PrimaryButtonText));
+ {
+ OnPropertyChanged(nameof(ShowConnect));
+ OnPropertyChanged(nameof(ShowGoLive));
+ }
}
}
- ///
- /// Single, context-aware primary button. Follows the user's journey:
- /// not connected → connect, connected+idle → go live, live → stop.
- ///
- public string PrimaryButtonText => !IsYouTubeConnected
- ? "Connect to YouTube"
- : IsLive
- ? "Stop Stream"
- : "Go Live";
+ public bool ShowConnect => !IsYouTubeConnected;
+ public bool ShowGoLive => IsYouTubeConnected && IsOffline;
// Commands
public ICommand AddSceneCommand { get; }
public ICommand RemoveSceneCommand { get; }
- public ICommand PrimaryCommand { get; }
+ public ICommand ConnectCommand { get; }
+ public ICommand GoLiveCommand { get; }
+ public ICommand EndStreamCommand { get; }
public MainViewModel()
{
@@ -98,7 +96,9 @@ public class MainViewModel : ViewModelBase
AddSceneCommand = new RelayCommand(_ => AddScene());
RemoveSceneCommand = new RelayCommand(scene => RemoveScene(scene as Scene));
- PrimaryCommand = new RelayCommand(_ => PrimaryAction());
+ ConnectCommand = new RelayCommand(_ => ConnectYouTube());
+ GoLiveCommand = new RelayCommand(_ => StartStream(), _ => IsYouTubeConnected && IsOffline);
+ EndStreamCommand = new RelayCommand(_ => StopStream(), _ => IsLive);
// Start with a default scene
AddScene("Scene 1");
@@ -150,14 +150,4 @@ public class MainViewModel : ViewModelBase
// For now, this is a stub
IsYouTubeConnected = false;
}
-
- private void PrimaryAction()
- {
- if (!IsYouTubeConnected)
- ConnectYouTube();
- else if (IsLive)
- StopStream();
- else
- StartStream();
- }
}