Skip to content

Support for Events in top-level ResourceDictionary #10109

@jeromelaban

Description

@jeromelaban

From #10094

Adding events in ResourceDictionary is not yet supported, to handle scenarios like this one:

<ResourceDictionary
    x:Class="testresdict.CommonRes"
    xmlns:local="using:testresdict"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Flyout x:Key="flkAccRej" x:Name="flAccRej" Placement="Bottom">
        <StackPanel>
            <TextBlock Text="To accept this change click Accept. Rejecting will delete the change." Margin="5"/>
            <CommandBar HorizontalAlignment="Left" DefaultLabelPosition="Right">
                <AppBarButton Icon="Accept" Label="Accept" Click="btnAccept_Click" />
                <AppBarButton Icon="Cancel" Label="Reject" Click="btnReject_Click" />
            </CommandBar>
        </StackPanel>
    </Flyout>

</ResourceDictionary>
namespace testresdict
{
    public sealed partial class CommonRes : ResourceDictionary
    {
        public CommonRes()
        {
            this.InitializeComponent();
        }

        private void btnAccept_Click(object sender, RoutedEventArgs e)
        {
            flAccRej.Hide();
        }

        private void btnReject_Click(object sender, RoutedEventArgs e)
        {
            flAccRej.Hide();
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/code-generationCategorizes an issue or PR as relevant to code generation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions