Skip to content

Show/hide Copy Page to Clipboard button based on current page#130

Merged
Timthreetwelve merged 2 commits into
mainfrom
CopyToClipboardButton
Jul 17, 2026
Merged

Show/hide Copy Page to Clipboard button based on current page#130
Timthreetwelve merged 2 commits into
mainfrom
CopyToClipboardButton

Conversation

@Timthreetwelve

Copy link
Copy Markdown
Owner

Added BooleanToVisibilityConverter to MainWindow.xaml and bound the Copy to Clipboard button's Visibility to a new ShowCopyButton property in NavigationViewModel. ShowCopyButton is now updated by navigation logic to hide the button on Settings and About pages and show it elsewhere.

Added BooleanToVisibilityConverter to MainWindow.xaml and bound the Copy to Clipboard button's Visibility to a new ShowCopyButton property in NavigationViewModel. ShowCopyButton is now updated by navigation logic to hide the button on Settings and About pages, and show it elsewhere.
Copilot AI review requested due to automatic review settings July 17, 2026 00:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the WPF UI to only display the “Copy Page to Clipboard” button when the currently selected navigation page supports page copying, by introducing a ShowCopyButton viewmodel property and binding the button’s Visibility to it.

Changes:

  • Added ShowCopyButton to NavigationViewModel and update it during navigation to hide the copy button on Settings/About pages.
  • Added a BooleanToVisibilityConverter resource and bound the copy button’s Visibility to ShowCopyButton in MainWindow.xaml.
  • Fixed clipboard behavior to return early for unsupported viewmodels (avoids continuing into the copy pipeline after reporting “invalid”).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
TimVer/ViewModels/NavigationViewModel.cs Adds and updates ShowCopyButton based on NavPage during navigation.
TimVer/MainWindow.xaml Binds the copy button visibility to the new ShowCopyButton property via BooleanToVisibilityConverter.
TimVer/Helpers/ClipboardHelper.cs Returns immediately on unsupported pages after notifying the user, preventing further copy attempts.

@Timthreetwelve
Timthreetwelve merged commit 300fe18 into main Jul 17, 2026
3 checks passed
@Timthreetwelve
Timthreetwelve deleted the CopyToClipboardButton branch July 17, 2026 00:13
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.

2 participants