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

Is there a way to find a child element of a certain type like Xamarin.forms.label inside a Page

$
0
0

This is my Custom page's XAML

            > <?xml version="1.0" encoding="utf-8" ?>
> <customcontrols:RC_Page xmlns="http://xamarin.com/schemas/2014/forms"
>              xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
>              xmlns:images="clr-namespace:RecoveryConnect_Mobile_PCL.Resources.Images;assembly=Blah_PCL"
>              x:Class="Blah.Views.Splash.Page_Splash"
>               xmlns:customcontrols="clr-namespace:Blah.CustomControls;assembly=RecoveryConnect_Mobile_PCL"
>             Title="Splash"
>              BackgroundColor="White">
>
>     <Image
>               Source="{x:Static images:AppResources.Image_Splash}"
>               Aspect="AspectFit" />
>
> </customcontrols:RC_Page>

This is the custom RC_Page's inherting off of ContentPAge.

public class RC_Page:ContentPage
{

            this.BackgroundColor = Color.Black;



    }
}

}

Is there a way I can do something like this.getChildOfType(Image);. That will give me a result of the Image element in the XAML?

  • My goal is to collect all the child elements in the page, so that I can apply some styling to them at runtime based on their type.
  • PS:- I do not want to do dynamic Resource Binding, but rather centralize everything at the RC_Page level itself.

Thanks


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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