Cleve
Cleve

Reputation: 1433

Can't get any Transitions to work with Popup in UWP

I trying to change the appearance of a Popup in a UWP App but I'm having trouble using any Transitions. Basically, the XAML parser throws an exception whatever Transition I use.

Please can someone help tell me what I'm doing wrong?

Here is some example XAML that blows up:

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Popup x:Name="popup" IsOpen="True">
        <Popup.Transitions>
            <PopupThemeTransition FromHorizontalOffset="100"/>
        </Popup.Transitions>
        <Border Background="Red" Width="100" Height="100"/>
    </Popup>
</Grid>

Upvotes: 0

Views: 319

Answers (1)

Sunteen Wu
Sunteen Wu

Reputation: 10627

The type of UIElement.Transitions property value should be TransitionCollection. We cannot directly give a PopupThemeTransition to Popup.Transitions. You code snippet is lacking of the TransitionCollection element. Right using as follows:

<Popup x:Name="StandardPopup" >
    <Popup.Transitions>
        <TransitionCollection>
            <PopupThemeTransition FromHorizontalOffset="100"/>
        </TransitionCollection>
    </Popup.Transitions>
    <Border Background="Red" Width="100" Height="100"/>
</Popup>

Upvotes: 1

Related Questions