locked
Image fading on windows store app c#

    Question

  • Hello,

    I am working on windows 8 store app in c#. I need to implement image fading in the app.

    I tried to add border over it and increase thickness but could not work.

    Can any one help me for how to implement it.

    Thanks

    • Moved by Mike Danes Monday, August 11, 2014 8:57 AM winstore specific
    Monday, August 11, 2014 8:55 AM

Answers

  • You could animate the Image's Opacity property using a DoubleAnimation:

    <Image x:Name="img" Source="omg.png" Width="100" Height="100">
                <Image.Triggers>
                    <EventTrigger RoutedEvent="Image.Loaded">
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetName="img" Storyboard.TargetProperty="Opacity" From="1" To="0" Duration="0:0:5"/>
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger>
                </Image.Triggers>
            </Image>

    The Duration property of the DoubleAnimation specifes the length of time for the fading.

    Monday, August 11, 2014 10:14 AM