Skip to content

Slider is buggy depending on order of properties #18910

@taori

Description

@taori

Description

I am binding to a viewModel which has min, max, value as observable properties.
If i have the following syntax it will work if i initialize my VM with Value = 100:

<Slider Maximum="{x:Binding Path=Max}" 
     Minimum="{x:Binding Path=Min}"
     Value="{x:Binding Path=Value, Mode=TwoWay}"
     DragCompletedCommand="{x:Binding Path=UpdateCommand}" />

while this will first set my VM property from 100 to 1.

<Slider Value="{x:Binding Path=Value, Mode=TwoWay}"
     Maximum="{x:Binding Path=Max}" 
     Minimum="{x:Binding Path=Min}"
     DragCompletedCommand="{x:Binding Path=UpdateCommand}" />

Order of properties mattering is not something i ran into with WPF. Perhaps this is a bug. One way or another this should be documented because it is rather confusing.

Steps to Reproduce

see above.

Link to public reproduction project repository

No response

Version with bug

7.0.101

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

Android

Affected platform versions

No response

Did you find any workaround?

Yes, changing the order of properties. Even testing this was a wild guess, because i cannot recall bindings working like this. Though i might have done it "right" by accident in the past.

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions