Thursday, January 17

Cool User Interface Designing With C# Animations and XAML Code

Source Code : Download Here
Screen Shot :



XAML Code :
<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="450" Width="750">
    <Grid>
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FF003431" Offset="0" />
                <GradientStop Color="#FF00C7B8" Offset="1" />
            </LinearGradientBrush>
        </Grid.Background>
        <Image Height="64" Source="buttonImg/button.png" Visibility="Hidden" Opacity=".7" HorizontalAlignment="Center" Margin="471,0,31,61" Name="ExtremeRightImg" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Height="35" Visibility="Hidden" Source="buttonIcons/backIcon.png" Opacity=".6" HorizontalAlignment="Center" Margin="514,0,74,90" Name="image32" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Content="Back" MouseEnter="ExtremeRightLabel_MouseEnter" MouseLeave="ExtremeRightLabel_MouseLeave" MouseDown="ExtremeRightLabel_MouseDown" MouseUp="ExtremeRightLabel_MouseUp" Visibility="Hidden" Height="64" HorizontalAlignment="Center" Margin="471,0,31,61" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Opacity=".5" Foreground="White" FontWeight="Bold" Name="ExtremeRightLabel" VerticalAlignment="Bottom" Width="125" />
        <Image Height="64" Source="buttonImg/button.png" Opacity=".7" HorizontalAlignment="Center" Margin="362,0,141,39" Name="RightImg" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Height="35" Source="buttonIcons/NewSale.png" Opacity=".6" HorizontalAlignment="Center" Margin="405,0,183,68" Name="image3" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Content="New Sale" MouseDown="RightLabel_MouseDown" MouseUp="RightLabel_MouseUp" Height="64" MouseEnter="RightLabel_MouseEnter" MouseLeave="RightLabel_MouseLeave" HorizontalAlignment="Center" Margin="361,0,141,39" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Opacity=".5" Foreground="White" FontWeight="Bold" Name="RightLabel" VerticalAlignment="Bottom" Width="125" />
        <Image Height="64" Visibility="Hidden" Source="buttonImg/button.png" Opacity=".7" HorizontalAlignment="Center" Margin="363,0,141,39" Name="RightImg1" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Visibility="Hidden" Height="35" Source="buttonIcons/Delete.png" Opacity=".6" HorizontalAlignment="Center" Margin="405,0,183,68" Name="image31" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Visibility="Hidden" Content="Delete" Height="64" MouseEnter="RightLabel1_MouseEnter" MouseLeave="RightLabel1_MouseLeave" MouseDown="RightLabel1_MouseDown" MouseUp="RightLabel1_MouseUp" HorizontalAlignment="Center" Margin="361,0,141,39" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Opacity=".5" Foreground="White" FontWeight="Bold" Name="RightLabel1" VerticalAlignment="Bottom" Width="125" />
        <Image Height="64" Visibility="Hidden" Source="buttonImg/button.png" Opacity=".7" HorizontalAlignment="Center" Margin="28,0,476,61" Name="ExtremeLeftImg" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Height="35" Source="buttonIcons/Update.png" Visibility="Hidden" Opacity=".6" HorizontalAlignment="Center" Margin="68,0,520,90" Name="Extremeimage1" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Content="Update" Visibility="Hidden" MouseEnter="ExtremeLeftLabel_MouseEnter" MouseLeave="ExtremeLeftLabel_MouseLeave" MouseDown="ExtremeLeftLabel_MouseDown" MouseUp="ExtremeLeftLabel_MouseUp" Height="64" HorizontalAlignment="Center" FontWeight="Bold" Margin="28,0,476,61" Foreground="White" Opacity=".5" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Name="ExtremeLeftLabel" VerticalAlignment="Bottom" Width="125" />
        <Image Height="64" Visibility="Hidden" Source="buttonImg/button.png" Opacity=".7" HorizontalAlignment="Center" Margin="140,0,364,39" Name="LeftImg1" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Height="35" Visibility="Hidden" Source="buttonIcons/ViewSale.png" Opacity=".6" HorizontalAlignment="Center" Margin="177,0,411,68" Name="image112" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Visibility="Hidden" MouseEnter="LeftLabel1_MouseEnter" MouseLeave="LeftLabel1_MouseLeave" MouseDown="LeftLabel1_MouseDown" MouseUp="LeftLabel1_MouseUp"  Content="View Report" Height="64" HorizontalAlignment="Center" FontWeight="Bold" Margin="140,0,364,39" Foreground="White" Opacity=".5" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Name="LeftLabel1" VerticalAlignment="Bottom" Width="125" />
        <Image Height="64" Source="buttonImg/button.png" Opacity=".7" HorizontalAlignment="Center" Margin="140,0,364,39" Name="LeftImg" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Height="35" Source="buttonIcons/display.png" Opacity=".6" HorizontalAlignment="Center" Margin="177,0,411,68" Name="image1" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Content="Dislay" MouseEnter="LeftLabel_MouseEnter" MouseUp="LeftLabel_MouseUp" MouseDown="LeftLabel_MouseDown" MouseLeave="LeftLabel_MouseLeave" Height="64" HorizontalAlignment="Center" FontWeight="Bold" Margin="140,0,364,39" Foreground="White" Opacity=".5" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Name="LeftLabel" VerticalAlignment="Bottom" Width="125" />
        <Image Height="64" HorizontalAlignment="Center" Margin="191,0,188,20" Opacity=".7" Name="CenterImg" Source="buttonImg/button.png" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Height="35" Source="buttonIcons/inventoryManage.png" Opacity=".6" HorizontalAlignment="Center" Margin="233,0,230,49" Name="image2" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Content="Inventory Manage" MouseDown="CenterLabel_MouseDown" MouseUp="CenterLabel_MouseUp" MouseEnter="CenterLabel_MouseEnter" MouseLeave="CenterLabel_MouseLeave" Opacity=".5" Foreground="White" FontWeight="Black" Height="64" HorizontalAlignment="Center" Margin="190,0,188,20" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Name="CenterLabel" VerticalAlignment="Bottom" Width="125" />
        <Image Height="64" Visibility="Hidden" HorizontalAlignment="Center" Margin="191,0,188,20" Opacity=".7" Name="CenterImg1" Source="buttonImg/button.png" Stretch="Fill" VerticalAlignment="Bottom" Width="125" >
            <Image.Effect>
                <DropShadowEffect Direction="270" BlurRadius="15" ShadowDepth="7" />
            </Image.Effect>
        </Image>
        <Image Visibility="Hidden" Height="35" Source="buttonIcons/NewSale.png" Opacity=".6" HorizontalAlignment="Center" Margin="233,0,230,49" Name="image21" Stretch="Fill" VerticalAlignment="Bottom" Width="40" />
        <Label Visibility="Hidden" MouseEnter="CenterLabel1_MouseEnter" MouseLeave="CenterLabel1_MouseLeave" MouseDown="CenterLabel1_MouseDown" MouseUp="CenterLabel1_MouseUp" Content="Add Stock"  Opacity=".5" Foreground="White" FontWeight="Black" Height="64" HorizontalAlignment="Center" Margin="228,0,226,20" HorizontalContentAlignment="Center" VerticalContentAlignment="Bottom" Name="CenterLabel1" VerticalAlignment="Bottom" Width="125" />
        <Image Height="150" HorizontalAlignment="Center" Margin="265,76,243,165" Name="ButtonIcons" Stretch="Fill" VerticalAlignment="Center" Width="150" />
        <Ellipse  Height="238" HorizontalAlignment="Center" Margin="103,42,101,131" Name="ellipse1" VerticalAlignment="Center" Width="524" StrokeThickness="10" Opacity="0" Fill="{x:Null}">
            <Ellipse.Stroke>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="#1700C7B8" Offset="0" />
                    <GradientStop Color="#1700C7B8" Offset="1" />
                    <GradientStop Color="Transparent" Offset="0.512" />
                </LinearGradientBrush>
            </Ellipse.Stroke>
            <Ellipse.Effect x:Uid="Effects">
                <BlurEffect Radius="5" />
            </Ellipse.Effect>
        </Ellipse>
        <Label Content="Choose From Menu"  FontFamily="Chiller" FontSize="24"  FontWeight="Bold" Height="35" HorizontalAlignment="Center" Margin="300,12,267,0" Name="label1" VerticalAlignment="Top" Width="161">
            <Label.Foreground>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="White" Offset="0" />
                    <GradientStop Color="White" Offset="0" />
                    <GradientStop Color="#FF00A8C7" Offset="1" />
                </LinearGradientBrush>
            </Label.Foreground>
            <Label.Effect>
                <DropShadowEffect />
            </Label.Effect>
        </Label>
    </Grid>
</Window>


C# Code :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Effects;
using System.Windows.Media.Animation;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace WpfApplication1
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }


        private void LeftLabel_MouseEnter(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/Display.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;
        }

        private void LeftLabel_MouseLeave(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void CenterLabel_MouseEnter(object sender, MouseEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            img.From = 0;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/inventoryManage.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;


        }

        private void CenterLabel_MouseLeave(object sender, MouseEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void RightLabel_MouseEnter(object sender, MouseEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            img.From = 0;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/NewSale.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;
        }

        private void RightLabel_MouseLeave(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void LeftLabel_MouseDown(object sender, MouseButtonEventArgs e)
        {
            LeftImg.Effect = null;
        }

        private void LeftLabel_MouseUp(object sender, MouseButtonEventArgs e)
        {
            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            LeftImg.Effect = effectsImg;
        }

        private void CenterLabel_MouseDown(object sender, MouseButtonEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 0.7;


            CenterImg.BeginAnimation(OpacityProperty, img);
            CenterLabel.BeginAnimation(OpacityProperty, img);
            image2.BeginAnimation(OpacityProperty, img);

            RightImg.BeginAnimation(OpacityProperty, img);
            RightLabel.BeginAnimation(OpacityProperty, img);
            image3.BeginAnimation(OpacityProperty, img);

            LeftImg.BeginAnimation(OpacityProperty, img);
            LeftLabel.BeginAnimation(OpacityProperty, img);
            image1.BeginAnimation(OpacityProperty, img);

            //Hide Items


            CenterImg.Visibility = System.Windows.Visibility.Hidden;
            CenterLabel.Visibility = System.Windows.Visibility.Hidden;
            image2.Visibility = System.Windows.Visibility.Hidden;

            RightImg.Visibility = System.Windows.Visibility.Hidden;
            RightLabel.Visibility = System.Windows.Visibility.Hidden;
            image3.Visibility = System.Windows.Visibility.Hidden;

            LeftImg.Visibility = System.Windows.Visibility.Hidden;
            LeftLabel.Visibility = System.Windows.Visibility.Hidden;
            image1.Visibility = System.Windows.Visibility.Hidden;
            //ends



            DoubleAnimation img1 = new DoubleAnimation();
            img1.To = 0.7;
            img1.From = 0;

            CenterImg1.BeginAnimation(OpacityProperty, img1);
            CenterLabel1.BeginAnimation(OpacityProperty, img1);
            image21.BeginAnimation(OpacityProperty, img1);

            RightImg1.BeginAnimation(OpacityProperty, img1);
            RightLabel1.BeginAnimation(OpacityProperty, img1);
            image31.BeginAnimation(OpacityProperty, img1);

            ExtremeRightImg.BeginAnimation(OpacityProperty, img1);
            ExtremeRightLabel.BeginAnimation(OpacityProperty, img1);
            image32.BeginAnimation(OpacityProperty, img1);

            Extremeimage1.BeginAnimation(OpacityProperty, img1);
            ExtremeLeftImg.BeginAnimation(OpacityProperty, img1);
            ExtremeLeftLabel.BeginAnimation(OpacityProperty, img1);

            LeftImg1.BeginAnimation(OpacityProperty, img1);
            LeftLabel1.BeginAnimation(OpacityProperty, img1);
            image112.BeginAnimation(OpacityProperty, img1);


            
            //Visible Items

            CenterImg1.Visibility = System.Windows.Visibility.Visible;
            CenterLabel1.Visibility = System.Windows.Visibility.Visible;
            image21.Visibility = System.Windows.Visibility.Visible;

            RightImg1.Visibility = System.Windows.Visibility.Visible;
            RightLabel1.Visibility = System.Windows.Visibility.Visible;
            image31.Visibility = System.Windows.Visibility.Visible;

            image32.Visibility = System.Windows.Visibility.Visible;
            ExtremeRightImg.Visibility = System.Windows.Visibility.Visible;
            ExtremeRightLabel.Visibility = System.Windows.Visibility.Visible;

            Extremeimage1.Visibility = System.Windows.Visibility.Visible;
            ExtremeLeftImg.Visibility = System.Windows.Visibility.Visible;
            ExtremeLeftLabel.Visibility = System.Windows.Visibility.Visible;

            LeftImg1.Visibility = System.Windows.Visibility.Visible;
            LeftLabel1.Visibility = System.Windows.Visibility.Visible;
            image112.Visibility = System.Windows.Visibility.Visible;

            //Ends


        }

        private void CenterLabel_MouseUp(object sender, MouseButtonEventArgs e)
        {

            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            CenterImg.Effect = effectsImg;
        }

        private void RightLabel_MouseDown(object sender, MouseButtonEventArgs e)
        {
            RightImg.Effect = null;
        }

        private void RightLabel_MouseUp(object sender, MouseButtonEventArgs e)
        {

            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            RightImg.Effect = effectsImg;
        }

        private void CenterLabel1_MouseEnter(object sender, MouseEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            img.From = 0;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/NewSale.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;
        }

        private void CenterLabel1_MouseLeave(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void CenterLabel1_MouseDown(object sender, MouseButtonEventArgs e)
        {
            CenterImg1.Effect = null;
        }

        private void CenterLabel1_MouseUp(object sender, MouseButtonEventArgs e)
        {
            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            CenterImg1.Effect = effectsImg;
        
        }

        private void RightLabel1_MouseEnter(object sender, MouseEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            img.From = 0;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/Delete.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;
        }

        private void RightLabel1_MouseLeave(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void RightLabel1_MouseDown(object sender, MouseButtonEventArgs e)
        {
            RightImg1.Effect = null;
        }

        private void RightLabel1_MouseUp(object sender, MouseButtonEventArgs e)
        {

            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            RightImg1.Effect = effectsImg;
        }

        private void ExtremeLeftLabel_MouseEnter(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            img.From = 0;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/Update.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;
        }

        private void ExtremeLeftLabel_MouseLeave(object sender, MouseEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void ExtremeLeftLabel_MouseDown(object sender, MouseButtonEventArgs e)
        {
            ExtremeLeftImg.Effect = null;
        }

        private void ExtremeLeftLabel_MouseUp(object sender, MouseButtonEventArgs e)
        {

            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            ExtremeLeftImg.Effect = effectsImg;
        }

        private void LeftLabel1_MouseEnter(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            img.From = 0;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/ViewSale.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;
        }

        private void LeftLabel1_MouseLeave(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void LeftLabel1_MouseDown(object sender, MouseButtonEventArgs e)
        {
            LeftImg1.Effect = null;
        }

        private void LeftLabel1_MouseUp(object sender, MouseButtonEventArgs e)
        {
            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            LeftImg1.Effect = effectsImg;
        
        }

        private void ExtremeRightLabel_MouseEnter(object sender, MouseEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = 1;
            img.From = 0;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
            BitmapImage imgIcon = new BitmapImage(new Uri("ButtonIcons/BackIcon.png", UriKind.Relative));
            ButtonIcons.Source = imgIcon;
        }

        private void ExtremeRightLabel_MouseLeave(object sender, MouseEventArgs e)
        {
            DoubleAnimation img = new DoubleAnimation();
            img.To = 0;
            img.From = 1;
            ButtonIcons.BeginAnimation(OpacityProperty, img);
            ellipse1.BeginAnimation(OpacityProperty, img);
        }

        private void ExtremeRightLabel_MouseDown(object sender, MouseButtonEventArgs e)
        {

            DoubleAnimation img = new DoubleAnimation();
            img.To = .7;
            img.From = 0;


            CenterImg.BeginAnimation(OpacityProperty, img);
            CenterLabel.BeginAnimation(OpacityProperty, img);
            image2.BeginAnimation(OpacityProperty, img);

            RightImg.BeginAnimation(OpacityProperty, img);
            RightLabel.BeginAnimation(OpacityProperty, img);
            image3.BeginAnimation(OpacityProperty, img);


            LeftImg.BeginAnimation(OpacityProperty, img);
            LeftLabel.BeginAnimation(OpacityProperty, img);
            image1.BeginAnimation(OpacityProperty, img);
            //Visible Items

            CenterImg.Visibility = System.Windows.Visibility.Visible;
            CenterLabel.Visibility = System.Windows.Visibility.Visible;
            image2.Visibility = System.Windows.Visibility.Visible;

            RightImg.Visibility = System.Windows.Visibility.Visible;
            RightLabel.Visibility = System.Windows.Visibility.Visible;
            image3.Visibility = System.Windows.Visibility.Visible;

            LeftImg.Visibility = System.Windows.Visibility.Visible;
            LeftLabel.Visibility = System.Windows.Visibility.Visible;
            image1.Visibility = System.Windows.Visibility.Visible;
            //ends

            //Hidden Items


            DoubleAnimation img1 = new DoubleAnimation();
            img.To = 0;
            img.From = 0.7;

            CenterImg1.BeginAnimation(OpacityProperty, img1);
            CenterLabel1.BeginAnimation(OpacityProperty, img1);
            image21.BeginAnimation(OpacityProperty, img1);

            RightImg1.BeginAnimation(OpacityProperty, img1);
            RightLabel1.BeginAnimation(OpacityProperty, img1);
            image31.BeginAnimation(OpacityProperty, img1);

            ExtremeRightImg.BeginAnimation(OpacityProperty, img1);
            ExtremeRightLabel.BeginAnimation(OpacityProperty, img1);
            image32.BeginAnimation(OpacityProperty, img1);

            Extremeimage1.BeginAnimation(OpacityProperty, img1);
            ExtremeLeftImg.BeginAnimation(OpacityProperty, img1);
            ExtremeLeftLabel.BeginAnimation(OpacityProperty, img1);

            LeftImg1.BeginAnimation(OpacityProperty, img1);
            LeftLabel1.BeginAnimation(OpacityProperty, img1);
            image112.BeginAnimation(OpacityProperty, img1);




            CenterImg1.Visibility = System.Windows.Visibility.Hidden;
            CenterLabel1.Visibility = System.Windows.Visibility.Hidden;
            image21.Visibility = System.Windows.Visibility.Hidden;

            RightImg1.Visibility = System.Windows.Visibility.Hidden;
            RightLabel1.Visibility = System.Windows.Visibility.Hidden;
            image31.Visibility = System.Windows.Visibility.Hidden;

            image32.Visibility = System.Windows.Visibility.Hidden;
            ExtremeRightImg.Visibility = System.Windows.Visibility.Hidden;
            ExtremeRightLabel.Visibility = System.Windows.Visibility.Hidden;

            Extremeimage1.Visibility = System.Windows.Visibility.Hidden;
            ExtremeLeftImg.Visibility = System.Windows.Visibility.Hidden;
            ExtremeLeftLabel.Visibility = System.Windows.Visibility.Hidden;

            LeftImg1.Visibility = System.Windows.Visibility.Hidden;
            LeftLabel1.Visibility = System.Windows.Visibility.Hidden;
            image112.Visibility = System.Windows.Visibility.Hidden;

        }

        private void ExtremeRightLabel_MouseUp(object sender, MouseButtonEventArgs e)
        {
            DropShadowEffect effectsImg = new DropShadowEffect();
            effectsImg.BlurRadius = 15;
            effectsImg.Direction = 270;
            effectsImg.ShadowDepth = 7;
            ExtremeRightImg.Effect = effectsImg;
        
        }
    }
}

Timer Function in C# WPF XAML

Download Source Code : TimerFunction
Screen Shot :

C# Code :
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Timers;
using System.Windows.Forms;
using System.Windows.Threading;
namespace timeFunction
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
         DispatcherTimer timer;
         public MainWindow()
         {
             InitializeComponent();
             timer = new DispatcherTimer();
                     timer.Interval = TimeSpan.FromSeconds(1.0);
                     timer.Start();
                     timer.Tick += new EventHandler(delegate(object s, EventArgs a)
        {
         label1.Content = ((DateTime.Now.Hour > 12) ? DateTime.Now.Hour % 12 : DateTime.Now.Hour) + ":"
                     + DateTime.Now.Minute + ":"
                     + DateTime.Now.Second
                     + ((DateTime.Now.Hour > 12) ? " pm" : " am");
        });
       }
                    
  }
}



XML Parser in c# Windows form application

Download Source Code Here : SimpleXMLParser
Screen Shots :

C# Code :
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;
using System.Xml;

namespace SimpleXMLParser
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
private System.Windows.Forms.Button button1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;

public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent();

//
// TODO: Add any constructor code after InitializeComponent call
//
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if (components != null) 
{
components.Dispose();
}
}
base.Dispose( disposing );
}

#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
            this.button1 = new System.Windows.Forms.Button();
            this.SuspendLayout();
            // 
            // button1
            // 
            this.button1.Location = new System.Drawing.Point(78, 199);
            this.button1.Name = "button1";
            this.button1.Size = new System.Drawing.Size(128, 32);
            this.button1.TabIndex = 0;
            this.button1.Text = "Read XML File !";
            this.button1.Click += new System.EventHandler(this.button1_Click);
            // 
            // Form1
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(292, 266);
            this.Controls.Add(this.button1);
            this.Name = "Form1";
            this.Text = "XML Parser";
            this.ResumeLayout(false);

}
#endregion

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main() 
{
Application.Run(new Form1());
}

private void button1_Click(object sender, System.EventArgs e)
{
try
{
XmlDocument xDoc = new XmlDocument();
xDoc.Load("sampleXML.xml"); //File is located in the "\bin\Debug" folder

XmlNodeList name = xDoc.GetElementsByTagName("myName");
XmlNodeList telephone = xDoc.GetElementsByTagName("myTelephone");
XmlNodeList email = xDoc.GetElementsByTagName("myEmail");
XmlNodeList age = xDoc.GetElementsByTagName("myAge");
XmlNodeList sex = xDoc.GetElementsByTagName("mySex");

MessageBox.Show(
"Name: " + name[0].InnerText +"\n"+
"Telephone: " + telephone[0].InnerText +"\n"+
"Email: "+ email[0].InnerText +"\n"+
"Age: "+ age[0].InnerText +"\n"+
"sex: "+ sex[0].InnerText +"\n"
);

}
catch(Exception ex)
{
MessageBox.Show(ex.Message);
}
}
}
}