refactor: extract BottomBar out of MainWindow.xaml — Phase 2, Commit 12
New Controls/ folder + namespace ytLive.Controls. BottomBar takes the Grid.Row=3 footer: gear menu button (with its GearButton_Click handler moved to the control's code-behind), centered stream-stats (bitrate/FPS/dropped/ duration/health), and the quality dropdown. All bindings inherit the window DataContext; app-level styles resolve from Themes/Controls.xaml as before. Zero behavior change; build 0 warnings; 246 pass, only the 2 known failures. Docs: ViewModels/index.md tracker gains a Phase 2 section in the same commit.
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
namespace ytLive.Controls;
|
||||
|
||||
public partial class BottomBar : UserControl
|
||||
{
|
||||
public BottomBar()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void GearButton_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is Button { ContextMenu: { } menu } button)
|
||||
{
|
||||
menu.PlacementTarget = button;
|
||||
menu.Placement = System.Windows.Controls.Primitives.PlacementMode.Bottom;
|
||||
menu.IsOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user