Unknown error in Custom Control using AppBarButton

1

I'm writing an app for UWP using C# and have come across a strange error that I can't seem to fix. When I put an AppBarButton inside an ItemsControl and click it, it causes an error.

This happens whether I bind the AppBarButton or put it in manually. This happens even if I put it in a clean Custom Control. It doesn't happen if I don't put the ItemsControl inside a Custom Control. It also doesn't happen if I put the AppBarButton inside a StackPanel or a Listview.

Here is the error I get: In a popup box:

Unhandled exception at 0x00007FFBFF3BCE8B (Windows.UI.Xaml.dll) in TorahScrollMVVM.exe: 0xC000027B: An application-internal exception has occurred (parameters: 0x000002A44F259E30, 0x0000000000000001).

and when I Break: error

My XAML is simply:

<Style TargetType="controls:CustomControl1">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="controls:CustomControl1">
                <ItemsControl>
                    <AppBarButton Icon="Target"/>
                </ItemsControl>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
</Style>

Anyone have any idea what is happening?

Thanks

c#
xaml
exception
custom-controls
win-universal-app
asked on Stack Overflow Feb 28, 2016 by Ivel97

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0