locked
Can't add property Name in UIElement inside a Flyout Control

    Question

  • Hello,

    I have defined a UserControl that inherit from Flyout. In this class, I have xaml side defined a Texblock with a Name.

    Like that:

    <Flyout
        x:Class="App.MyFlyout"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d">    
        <Grid>
            <TextBlock x:Name="Hello"></TextBlock>
        </Grid>
    </Flyout>

    When I compile I have the following error: App.MyFlyout does not contain a definition for 'FindName' and no extension method 'FindName' accepting a first argument of type App.MyFlyout could be found.

    If I move this code to a normal page. It perfectly works. (without redefining a usercontrol)

    Is it possible to create a custom UserControl that inherit from Flyout in a page?

    Monday, July 21, 2014 11:10 AM

Answers