Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 91519

How to access xaml elements that is inside another xaml?

$
0
0

I have a view that is reference in two different content pages. How can I access the content view properties that inside the content page? I want to access "myLabel" properties from the content page.

Content View and Content Page

<?xml version="1.0" encoding="UTF-8"?>
<ContentView 
    xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    x:Class="MyProject.Views.MyView">
    <StackLayout
        VerticalOptions="End"
        Orientation="Horizontal"
        HorizontalOptions="FillAndExpand"
        Spacing="0">
        <Entry
            x:Name="myEntry"
            HorizontalOptions="End"
            HeightRequest="40"
            WidthRequest="40">
        </Image>
    </StackLayout>
</ContentView>

<?xml version="1.0" encoding="UTF-8"?>
<ContentPage 
    xmlns="http://xamarin.com/schemas/2014/forms" 
    xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
    xmlns:view="clr-namespace:MyProject.Views;assembly=MyProject"
    x:Class="MyProject.Pages.MyPage">
    <ContentPage.Content>
        <StackLayout
            Orientation="Vertical"
            VerticalOptions="FillAndExpand"
            Spacing="0">
            <view:MyView/>
        </StackLayout>
    </ContentPage.Content>
</ContentPage>

Viewing all articles
Browse latest Browse all 91519

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>