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

Cannot {x:Bind} to property of named non-control in C++/WinRT #10130

Open
HO-COOH opened this issue Nov 2, 2024 · 3 comments
Open

Cannot {x:Bind} to property of named non-control in C++/WinRT #10130

HO-COOH opened this issue Nov 2, 2024 · 3 comments
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners

Comments

@HO-COOH
Copy link

HO-COOH commented Nov 2, 2024

Describe the bug

Related to #2721, that issue is fixed, we can now bind to a property of a named control, but binding to named non-control is still causing compile error (you still need to redeclare it in the idl).

Steps to reproduce the bug

  1. Create a new C++ winui3 project
  2. In MainWindow.xaml, use this xaml
    <StackPanel Orientation="Vertical" Spacing="10">
        <Slider
            x:Name="RotationSlider"
            Width="500"
            Value="{x:Bind Rotation.Angle, Mode=TwoWay}" />

        <Border
            Width="500"
            Height="500"
            Background="Red">
            <Border.RenderTransform>
                <RotateTransform x:Name="Rotation" />
            </Border.RenderTransform>
        </Border>
    </StackPanel>

Expected behavior

No response

Screenshots

No response

NuGet package version

WinUI 3 - Windows App SDK 1.6.1: 1.6.240923002

Windows version

No response

Additional context

Repro

@HO-COOH HO-COOH added the bug Something isn't working label Nov 2, 2024
@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Nov 2, 2024
@karkarl
Copy link
Contributor

karkarl commented Nov 7, 2024

Your example here is not expected to work, as RotateTransform is not a dependency object. Hence, the TwoWay binding will not work.

@karkarl karkarl closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
@karkarl karkarl removed the needs-triage Issue needs to be triaged by the area owners label Nov 7, 2024
@HO-COOH
Copy link
Author

HO-COOH commented Nov 8, 2024

Your example here is not expected to work, as RotateTransform is not a dependency object. Hence, the TwoWay binding will not work.

@karkarl I might be drunk then.
Image

Also, the exact code works in C# project.

@microsoft-github-policy-service microsoft-github-policy-service bot added the needs-triage Issue needs to be triaged by the area owners label Nov 8, 2024
@karkarl
Copy link
Contributor

karkarl commented Nov 8, 2024

@chrisglein can you take a look at this?

@karkarl karkarl reopened this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs-triage Issue needs to be triaged by the area owners
Projects
None yet
Development

No branches or pull requests

2 participants