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

Change in MultiBinding behaviour in 11.1.0-rc1 compared to 11.0.11 #16084

Closed
mysticpillow opened this issue Jun 21, 2024 · 8 comments · Fixed by #16219
Closed

Change in MultiBinding behaviour in 11.1.0-rc1 compared to 11.0.11 #16084

mysticpillow opened this issue Jun 21, 2024 · 8 comments · Fixed by #16219

Comments

@mysticpillow
Copy link

mysticpillow commented Jun 21, 2024

Describe the bug

Manually calling ObservableObject.OnPropertyChanged(propertyName) does not trigger MultiBinding in 11.1.0-rc1 compared to 11.0.11.
It still works after scrolling down to hide node from view and up to show again. Also works for child nodes after collapsing/expanding parent node.

To Reproduce

XAML code inside DataTemplate of TreeDataGrid column

<ContentControl.Content>
    <MultiBinding Converter="{x:Static converters:DataUseStateToIconConverter.Instance}">
        <Binding DataType="views:CustomTree" Path="#customTree" />
        <Binding DataType="models:TreeNode" Path="(models:TreeNode)" />
        <Binding DataType="models:TreeNode" Path="(models:TreeNode).DataUseStateUpdater"/>
    </MultiBinding>
</ContentControl.Content>

Code-behnid
OnPropertyChanged(nameof(DataUseStateUpdater)); is called inside TreeNode model
TreeNode is ObservableObject
DataUseStateUpdater is ObservableProperty

Expected behavior

Calling OnPropertyChanged(propertyName) manually should trigger MultiBinding with a Binding to the property. Then converter should be used.

Avalonia version

11.1.0-rc1

OS

Windows

Additional context

No response

@timunie
Copy link
Contributor

timunie commented Jun 22, 2024

Please file a minimum sample to reproduce.

@mysticpillow mysticpillow changed the title Change in MultiBinding behaviour in 11.1.0-rc1 compared to 11.0.10 Change in MultiBinding behaviour in 11.1.0-rc1 compared to 11.0.11 Jun 22, 2024
@mysticpillow
Copy link
Author

A minimum repro: https://github.com/mysticpillow/MultiBindingRegressionRepro
It uses a simple TextBlock instead of TreeDataGrid.
Actually MultiBinding stopped working at 11.1.0-beta1 version.

@mysticpillow
Copy link
Author

I think #16137 is closely related to this issue. In my example a MultiBinding converter (which is also custom) is used only once and then ignores following OnPropertyChanged calls in the same way.

@grokys
Copy link
Member

grokys commented Jun 26, 2024

Yep, this looks like the same issue as #16137 in that you're raising a PropertyChanged event on a property that hasn't changed, and expecting that to trigger a side-effect. My comment in #16137 (comment) also stands for this issue.

Given that these two issues have the same root cause I'm going to close this issue and track it in #16137.

@grokys grokys closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
@grokys
Copy link
Member

grokys commented Jun 28, 2024

Reopening this issue because although it has the same root cause as #16137, the fix for it is more difficult. I don't think a fix for this regression will make it into 11.1.0 as:

@grokys grokys reopened this Jun 28, 2024
grokys added a commit that referenced this issue Jul 3, 2024
maxkatz6 pushed a commit that referenced this issue Aug 7, 2024
* Update BindingBase.Instance signature.

- Swap `target` and `targetProperty` order to make it consistent with other similar methods
- Make `targetProperty` nullable as it will need to be null for `MultiBinding`

* IBinding2.Instance needs to accept a null target property.

It will need to be null for `MultiBinding`.

* Attach needs to accept a null target property.

It will need to be null for `MultiBinding`.

* Initial implementation of MultiBindingExpression.

* Fix failing template binding test.

Only publish unset value if we've already published a value.

* Enabled nullability annotations.

* Added passing test for #16084.

* Remove obsolete API usages.

* Bind to Tag not Text.

Prevents test passing when it shouldn't. See #16219 (comment)

* Handle DoNothing in MultiBindingExpression.
@spacilv
Copy link

spacilv commented Aug 13, 2024

It is still not working in version 11.1.3, MultiBinding is not revalidated.

@timunie
Copy link
Contributor

timunie commented Aug 13, 2024

@spacilv should be available in nightly or 11.2 as per #16084 (comment)

@spacilv
Copy link

spacilv commented Aug 14, 2024

@spacilv should be available in nightly or 11.2 as per #16084 (comment)

Thank you, I missed that info. We have to wait for 11.2 then, current version 11.1.3 is unusable for us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants