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

Using x:Name on custom controls does not work. Is this correct?

$
0
0

I have the page:

<?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:local="clr-namespace:myproj.CustomControls;assembly=myproj"
             x:Class="myproj.Views.myCustomPage">
  <local:MyCustomControl x:Name="myControl"></local:MyCustomControl>
</ContentPage>

and in the code behind I am trying to do:

        protected override void OnAppearing()
        {

            if (this.myControl.BindingContext != null)
            {
                this.myControl.RedrawControl();
            }
            base.OnAppearing();
        }

But I keep getting.

My View does not myCustomPagea definition for myControl

my build action for my page is EmbeddedResource and custom tool MSBuild:UpdateDesignTimeXaml.

Is this correct? I am using latest stable release of Xamarin.Forms


Viewing all articles
Browse latest Browse all 91519

Trending Articles



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