-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
DropDownButton, command binding failed on itemssource #4512
Comments
How is ViewModelItem defined? |
i don't think it's relevant because the command is in the parent.. ChangeDisplayModeCommand `
} |
btw i found a workaround by sending a message to the parent when the IsSelected change |
DisplayMode, Header and Tag are not observable and thus will not invalidate the command. If you use the MVVM Toolkit, you may need to invalidate the partent command when selection is changed. this is by design for performace reasons and not a bug in MahApps |
There is no need for that , theses properties are not involved in the problem. and there no need to invalidate the command because its allways true. IsSelected is well updated when I click an item
the command in the style is not working for added items |
Describe the bug
With the same model, ItemsSource is bind to an observable collection of ViewModelItem
the first items are working, check is ok and command is called
if items are added after, the command is not called
Steps to reproduce
then start
after another event add some items
plans.ForEach(p=> Displays.Add( new DisplayModeItem() { Header = p.Name, Mode = DisplayMode.Map, Tag = p } ) );
checking these items is not calling the command
but the IsSelected changed and the binding below works
Environment
The text was updated successfully, but these errors were encountered: