The XAML file is as follows:
<?xml version="1.0" encoding="utf-8"?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="WPapp.Views.Home"
x:Name="HomeHeader">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Refresh"
x:Name="refreshButton"
Clicked="refreshButton_Clicked"/>
</ContentPage.ToolbarItems>
<ContentPage.Content>
<ScrollView>
<StackLayout Margin="10"
HorizontalOptions="Center"
VerticalOptions="FillAndExpand"
x:Name="HomeContainer">
<Label Text="Featured Posts"
FontSize="Title"
FontAttributes="Bold"
Margin="0, 20, 10, 0"/>
<CarouselView>
<CarouselView.ItemTemplate>
<DataTemplate>
<StackLayout x:Name="FeaturedContainer"/>
</DataTemplate>
</CarouselView.ItemTemplate>
</CarouselView>
</StackLayout>
</ScrollView>
</ContentPage.Content>
</ContentPage>
With this line in the c# file,
FeaturedContainer.Children.Clear();
I am getting the following error:
Error CS0103: The name 'FeaturedContainer' does not exist in the current context (CS0103)
What am I doing wrong?