Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DRAFT] Clipboard History #151

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft

Conversation

joadoumie
Copy link
Collaborator

@joadoumie joadoumie commented Nov 12, 2024

This is at a reasonable place right now, but still needs some TLC before it is finished... and I got a little stuck so switching gears for sanity's sake.

My primary issue was trying to figure out how to use IRandomAccessStream as a valid ctor param and wiring that all up... I tried... and I'm reverting back to this commit and PR.

Here are the main things that need to be added:

  • IRandomAccessStream can be passed as the Hero Image in the details view -- this stumped me for now.
  • Event Handler for new clipboard events and raise items changed in that case to update the list items with whatever changes were made to the clipboard history (marked as TODO in code)
  • Clean up the details pane so the previews look cleaner
  • Fix the weird behavior for CommandResult.Dismiss() not giving the right level of focus back to the window before (e.g. Word has cursor focus, command palette is launched, command is invoked, dismiss() is called, Word should have focus WITH the cursor again)

@zadjii-msft zadjii-msft mentioned this pull request Dec 9, 2024
zadjii-msft added a commit that referenced this pull request Dec 10, 2024
This adds a magic helper to load icons for us. Any time you want an icon, just do this:

```xaml
<Border Width="16"
        Height="16"
        Margin="4,4,4,4">
    <Interactivity:Interaction.Behaviors>
        <cmdpalUI:LoadIconBehavior Source="{x:Bind ViewModel.PrimaryAction.Icon, Mode=OneWay}"/>
    </Interactivity:Interaction.Behaviors>
</Border>
```

And that'll magically give us a border filled with the icon, and updating with the binding.

I believe it'll also work with `IRandomAccessStreamReference`s, but I didn't actually test that with #151 yet. 

I didn't actually implement the "caching" bit of this yet. That'll involve doing some locking per-key inside the factory and I didn't want to futz with that in this initial PR to restore icons

---------

Co-authored-by: Mike Griese <[email protected]>
@zadjii-msft
Copy link
Owner

For my own notes:

@zadjii-msft
Copy link
Owner

GAH we can't use randomaccessstreams in icons till #333 is fixed

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.

CommandResult.Dismiss() should leave the user in the precise state they were in before launching
3 participants