© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
7 replies
.tree

❔ XAML accessing property of parent views element

I have this structure in XAML:

<RelativeLayout>
    <Grid1>
        <tabView>
            <tabView.Item>
                <MyView>
    <Grid2>
        <MyView2 x:Name="MyView2" IsVisible = false>
<RelativeLayout>
    <Grid1>
        <tabView>
            <tabView.Item>
                <MyView>
    <Grid2>
        <MyView2 x:Name="MyView2" IsVisible = false>


In the code behind of
MyView
MyView
I want to set
MyView2
MyView2
's
IsVisible
IsVisible
property to true on a button click. I tried it using
Parent.Parent.Parent.Parent.FindByName<MyView2>("MyView2").IsVisible = true;
Parent.Parent.Parent.Parent.FindByName<MyView2>("MyView2").IsVisible = true;

but couldnt get anything to show on button press.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

XAML property issues
C#CC# / help
12mo ago
❔ XAML nested View, Parent is null?
C#CC# / help
3y ago
Problem with corner radius XAML property
C#CC# / help
2y ago
❔ Can't get root XAML element of UserControl for binding
C#CC# / help
3y ago