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

RightClickCommand missing #38

Open
ssolmer opened this issue Aug 19, 2020 · 2 comments
Open

RightClickCommand missing #38

ssolmer opened this issue Aug 19, 2020 · 2 comments

Comments

@ssolmer
Copy link

ssolmer commented Aug 19, 2020

I have a requirement to show the application window on any interaction with the tasktray icon.
LeftClickCommand works great, but there is nothing for right-click.
I tried handling MouseRightButtonUp but it doesn't seem to work. I think the event doesn't originate from the notify icon.

        <tb:TaskbarIcon x:Name="MyNotifyIcon"
                        NoLeftClickDelay="True"                  
                        IconSource="{Binding Path=DynamicAppIcon}"                        
                        DoubleClickCommand="{Binding ShowWindowCommand}"
                        LeftClickCommand="{Binding ShowWindowCommand}">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="MouseRightButtonUp">
                    <i:InvokeCommandAction Command="{Binding ShowWindowCommand}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </tb:TaskbarIcon>

Would it be possible to create a RightClickCommand ?

@ssolmer
Copy link
Author

ssolmer commented Aug 19, 2020

Handling the MouseRightButtonUp event normally in the view .cs file, the event still does not get fired.

This is the error message when attempting to use the command binding above:

System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=ShowWindowCommand; DataItem='ViewModel' (HashCode=6956456); target element is 'InvokeCommandAction' (HashCode=51797270); target property is 'Command' (type 'ICommand')

@SparrowBrain
Copy link

I used to use TrayRightMouseDown for right click command.

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

No branches or pull requests

2 participants