locked
how to start theme transitions from code behind file in windows 8 apps ?

    Question

  • i had a windows 8 app built with c# & xaml, i had declared PopupThemeTransition for a textblock in xaml, but i want to begin this transition effect through c# file, is it possible ?, if so please guide me.
    Thursday, August 14, 2014 7:21 AM

Answers

  • Hi kranthi88,

    It is possible, use following code:

        <Page.Resources>
             <Storyboard x:Name="sb">
                 <PopInThemeAnimation Storyboard.TargetName="txtblock" />
             </Storyboard>
         </Page.Resources>
         
         <Grid>
             <Textblock x:Name="txtblock"  />
             <Button Width="200" Height="100" Content="Show" Click="OnClick"     />
         </Grid>
    
    void OnClick(object sender, RoutedEventArgs e)
     {
          sb.Begin();
     }
    

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Marked as answer by kranthi88 Monday, August 18, 2014 5:42 AM
    Friday, August 15, 2014 10:07 AM
    Moderator