Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: make notifyicon contextmenu display#1534

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
IOL0ol1 wants to merge1 commit intolepoco:main
base:main
Choose a base branch
Loading
fromIOL0ol1:patch-1

Conversation

IOL0ol1
Copy link

Pull request type

Please check the type of change your PR introduces:

  • Update
  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes

What is the current behavior?

Issue Number: N/A

NotifyIcon's ContextMenu not display

What is the new behavior?

  • now we can see the NotifyIcon's ContextMenu

Other information

The context menu isn't part of the same visual tree and therefore doesn't have the same DataContext.
I have provided a tip here to solve this problem.

@IOL0ol1
Copy link
Author

use x:Name=MainWindow is better, but i want less code.

TooltipText="WPF UI Gallery">
<tray:NotifyIcon.Menu>
<ContextMenuItemsSource="{Binding ViewModel.TrayMenuItems, Mode=OneWay}" />
<ContextMenuDataContext="{Binding DataContext, Source={x:Reference NavigationView}}"ItemsSource="{Binding ViewModel.TrayMenuItems, Mode=OneWay}" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Author

Choose a reason for hiding this comment

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

<tray:NotifyIconFocusOnLeftClick="True"MenuOnRightClick="True"><tray:NotifyIcon.Resources><DiscreteObjectKeyFrame x:Key="proxy"Value="{Binding}"/></tray:NotifyIcon.Resources><tray:NotifyIcon.Menu><ContextMenu  DataContext="{Binding Source={StaticResource proxy},Path=Value}"><ui:MenuItem                   Name="OpenSettings"Command="{Binding OpenSettingsCommand}"CommandParameter="123"Header="{x:Static str:Resources.AppSetting}"/><ui:MenuItem                   Name="Exit"                   Command="{Binding ExitAppCommand}"                   Header="{x:Static str:Resources.AppExit}"/></ContextMenu></tray:NotifyIcon.Menu></tray:NotifyIcon>

ok,i have plan b

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

Reviewers

@pomianowskipomianowskiAwaiting requested review from pomianowskipomianowski is a code owner

1 more reviewer

@chuckerchuckerchucker left review comments

Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

galleryWPF UI GalleryPRPull requestrelease

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@IOL0ol1@chucker

[8]ページ先頭

©2009-2025 Movatter.jp