Skip to content

refactor: rename SelectionBarControl.CommandParameter to Selection - #1096

Open
huynhsontung with Copilot wants to merge 2 commits into
United600/fix-selection-bar-add-to-playlistfrom
copilot/rename-command-parameter-to-selection
Open

huynhsontung with Copilot wants to merge 2 commits into
United600/fix-selection-bar-add-to-playlistfrom
copilot/rename-command-parameter-to-selection

Conversation

Copilot AI commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

SelectionBarControl.CommandParameter no longer represented an arbitrary command parameter; it consistently carried the active selection model. This change renames the control API to Selection and updates the consumers so the selection flow remains explicit at every binding site.

  • Control API

    • Rename the dependency property from CommandParameter to Selection in SelectionBarControl.
    • Update the control's public surface and XML docs to describe the property as the active selection object rather than a generic command argument.
  • Internal control bindings

    • Rebind the control's action buttons to pass Selection into play, play-next, add-to-queue, and remove commands.
    • Update the add-to-playlist flyout behavior to receive Selection as its data context.
  • Consumer updates

    • Replace CommandParameter="{x:Bind ViewModel.Selection}" with Selection="{x:Bind ViewModel.Selection}" at all SelectionBarControl use sites, including Home and Play Queue surfaces.
<controls:SelectionBarControl
    PlayButtonCommand="{x:Bind ViewModel.PlaySelectedCommand}"
    PlayNextButtonCommand="{x:Bind ViewModel.PlaySelectedNextCommand}"
    RemoveButtonCommand="{x:Bind ViewModel.RemoveSelectedCommand}"
    Selection="{x:Bind ViewModel.Selection}" />

Copilot AI and others added 2 commits September 16, 2026 08:55
Co-authored-by: huynhsontung <31434093+huynhsontung@users.noreply.github.com>
Co-authored-by: huynhsontung <31434093+huynhsontung@users.noreply.github.com>
x:Name="PlayButton"
Command="{x:Bind PlayButtonCommand}"
CommandParameter="{x:Bind CommandParameter}"
CommandParameter="{x:Bind Selection}"

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels unnecessary, so we should drop it from any buttons that don't require it and keep it solely on the AddToPlaylistButton. Unless we revert the commands to require a parameter again, but that doesn't seem practical.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants