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

FrameworkElement.FindName doesn't look for resources #7043

Open
Youssef1313 opened this issue Sep 13, 2021 · 0 comments · May be fixed by #16177
Open

FrameworkElement.FindName doesn't look for resources #7043

Youssef1313 opened this issue Sep 13, 2021 · 0 comments · May be fixed by #16177
Assignees
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working low-hanging-🍒 Categorizes an issue that might be a quick win with meaningful positive impact. project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...)

Comments

@Youssef1313
Copy link
Member

Current behavior

    <Grid x:Name="grid">
        <Grid.Resources>
            <Button x:Name="MyButton" />
        </Grid.Resources>
        <Button Click="Button_Click"></Button>
    </Grid>
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var x = grid.FindName("MyButton"); // Returns null.
        }

Expected behavior

Shouldn't return null, as in UWP.

How to reproduce it (as minimally and precisely as possible)

Workaround

No response

Works on UWP/WinUI

Yes

Environment

No response

NuGet package version(s)

No response

Affected platforms

iOS, Android, WebAssembly, macOS, Skia (WPF), Skia (GTK on Linux/macOS/Windows), Skia (Tizen)

IDE

No response

IDE version

No response

Relevant plugins

No response

Anything else we need to know?

No response

@Youssef1313 Youssef1313 added difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. kind/bug Something isn't working triage/untriaged Indicates an issue requires triaging or verification labels Sep 13, 2021
@jeromelaban jeromelaban added the project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...) label Sep 13, 2021
@MartinZikmund MartinZikmund added difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI low-hanging-🍒 Categorizes an issue that might be a quick win with meaningful positive impact. and removed triage/untriaged Indicates an issue requires triaging or verification difficulty/tbd Categorizes an issue for which the difficulty level needs to be defined. labels Jul 18, 2023
@Youssef1313 Youssef1313 self-assigned this Apr 8, 2024
@Youssef1313 Youssef1313 linked a pull request Apr 8, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty/medium 🤔 Categorizes an issue for which the difficulty level is reachable with a good understanding of WinUI kind/bug Something isn't working low-hanging-🍒 Categorizes an issue that might be a quick win with meaningful positive impact. project/resources 🈷️ Categorizes an issue or PR as relevant to resources and localization (Resources, Assets,...)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants