Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I am trying to perform fade in transition on a Window. I am able to do the transition but only to the contents of the window. I mean the frame of the window and title bar are not transforming like the content in it. Please check the XAML code below and see what has to be done for the whole window to fade in. Please dont tell me to set the allow transparency to true and window style to none. I want the title bar to fade in as well.


XML
<Window x:Class="WpfApplication6.newwindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="newwindow" Height="295" Width="371" PreviewStylusInRange="Window_PreviewStylusInRange">
<Window.Triggers>
    <EventTrigger RoutedEvent="Window.Loaded">
        <BeginStoryboard>
            <Storyboard>
                <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0" To="1" Duration="0:0:2" FillBehavior="HoldEnd" />
            </Storyboard>
        </BeginStoryboard>
    </EventTrigger>
</Window.Triggers>


<Grid Height="257" Width="349">
    <Label Content="Label" Height="28" HorizontalAlignment="Left" Margin="115,0,0,112" Name="label1" VerticalAlignment="Bottom" Width="127" Background="#FFDB1F1F" />


    </Grid>



I am using VS 2010 with .NET 3.5.

Thank you.
Posted
Updated 6-Mar-21 4:52am
v2
Comments
nlakumar 1-Oct-12 2:45am    
Come on guys someone help me.
Kenneth Haugland 1-Oct-12 5:05am    
Think you'll have to set the window style to borderless if thats going to work.

1 solution

set this property
AllowTransparency = true;
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900