2012/11/21

How to work process Loder in windows c#



1.       Create  ModelLodingUI  Window Form and set the property : FromBoderStyle- None
2.       Drag & Drop Picture Box and set Loading Image.
3.       Paste following code:
4.  namespace LoadingProcess
5.  {
6.      public partial class ModalLoadingUI : Form
7.      {
8.          #region Constants
9.          public bool CloseMe = false;
10.        #endregion
11. 
12.        public ModalLoadingUI()
13.        {
14.            InitializeComponent();
15.        }
16.        private void ModalLoadingUI_Load(object sender, EventArgs e)
17.        {
18. 
19.        }
20.        public void LoadForm()
21.        {
22.            this.Opacity = 0.5;
23.            this.BackColor = Color.Gray;
24.            this.Show();
25.            while (true)
26.            {
27.                if (CloseMe)
28.                {
29.                    Application.DoEvents();
30.                    CloseMe = false;
31. 
32.                    this.Close();
33.                    break;
34.                }
35.                else
36.                {
37.                    Application.DoEvents();
38.                }
39.            }
40. 
41.        }
42. 
43.    }
44.   }
II. Create Static Class like Program.cs:
static class Program
    {
        static ModalLoadingUI FormLoader;            

        public static void StartLoder()
        {
            FormLoader = new ModalLoadingUI();
            ThreadStart TS = new ThreadStart(FormLoader.LoadForm);
            Thread T = new Thread(TS);
            T.Start();
            Thread.Sleep(5000);
        }

        public static void StoptLoder()
        {
            FormLoader.CloseMe = true;
        }
    }
III. Call the function on page where you want to show the process.
private void button1_Click(object sender, EventArgs e)
        {
Program.StartLoder();
            // -----rite you code like saveData()-------------
            Thread.Sleep(5000);
            //-------------------
            Program.StoptLoder();        }


2012/11/20

How to export data in excel sheet

  public static void exportExcel(System.Data.DataTable dt, string fileName,string logoImagePath,string compName,string compDetails,string reportTitle)
        {
            // BackUp objBackUp = new BackUp();
            /*
             * un comment following code for password protected excel file
             */
            //Filename = AppDomain.CurrentDomain.BaseDirectory + fileName.Trim()+".xls";
            Filename = fileName;
            FileInfo f = new FileInfo(Filename);
            if (File.Exists(Filename))
            {
                try
                {
                    File.Delete(Filename);
                }
                catch
                {
                    MessageBox.Show("File is in use. Please Close Report.xls File...");
                    return;
                }
            }
            try
            {

                //File name and path, here i used abc file to be

                //stored in Bin directory in the sloution directory
                Microsoft.Office.Interop.Excel.Application exc = new Microsoft.Office.Interop.Excel.Application();

                //check if file already exists then delete

                //it to create a new file

                if (File.Exists(Filename))
                    File.Delete(Filename);
                if (!File.Exists(Filename))
                {
                    //create new excel application               
                    Microsoft.Office.Interop.Excel.Application oexcel = new Microsoft.Office.Interop.Excel.Application();

                    oexcel.DisplayAlerts = false;                //add a new workbook

                    obook = oexcel.Workbooks.Add(XlWBATemplate.xlWBATWorksheet);

                    oexcel.Visible = false;
                    osheet = (Microsoft.Office.Interop.Excel.Worksheet)oexcel.Worksheets[1];
                    osheet.Name = "Sheet1";

                    Range picRange = (Range)osheet.get_Range("A1", "C1");
                    picRange.Merge(true);
                    picRange.RowHeight = 60;
                    Image img = Image.FromFile(logoImagePath);
                    Clipboard.SetImage(img);
                    osheet.Paste(picRange, logoImagePath);

                   
                    Range rangeCompName = (Range)osheet.get_Range("E1", "J1");
                    rangeCompName.Merge(true);
                    rangeCompName.Font.Bold = true;
                    rangeCompName.Font.Size = 16;
                    rangeCompName.Value2 = compName;

                    Range rangeCompDetails = (Range)osheet.get_Range("C2", "J2");
                    rangeCompDetails.Merge(true);
                    rangeCompDetails.RowHeight = 40;
                    rangeCompDetails.Font.Bold = true;
                    rangeCompDetails.Font.Size = 12;
                    rangeCompDetails.Font.Underline = true;
                    rangeCompDetails.Value2 = compDetails;

                    Range rangeReportTitle = (Range)osheet.get_Range("A3", "J3");
                    rangeReportTitle.Merge(true);
                    rangeReportTitle.Font.Bold = true;
                    rangeReportTitle.Font.Size = 12;
                    rangeReportTitle.HorizontalAlignment = HorizontalAlignment.Center;
                    rangeReportTitle.Value2 = reportTitle;

                    for (int i = 0; i < dt.Columns.Count; i++)
                    {
                        osheet.Cells[6, i + 1] = dt.Columns[i].ColumnName.ToString();
                        double w = GetExcelColWidths(dt, i);
                        if (w < 255)
                        {
                            ((Range)osheet.Cells[6, i + 1]).ColumnWidth = w;
                        }
                        else
                        {
                            ((Range)osheet.Cells[6, i + 1]).ColumnWidth = 255;
                        }
                        ((Range)osheet.Cells[6, i + 1]).HorizontalAlignment = HorizontalAlignment.Center;                      
                    }
                    osheet.get_Range("A6", "AZ6").Font.Bold = true; ;
                   
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        for (int j = 0; j < dt.Columns.Count; j++)
                        {
                            Range range = (Range)osheet.Cells[i + 8, j + 1];
                            range.Value2 = dt.Rows[i][j] == null ? "" : dt.Rows[i][j].ToString();
                            range.HorizontalAlignment = HorizontalAlignment.Center;                           
                        }
                    }                   
                    oexcel.ActiveWorkbook.SaveCopyAs(Filename);                   
                    osheet = null;
                    obook.Close(true, Filename, Missing.Value);
                    obook = null;
                    oexcel.Quit();
                    oexcel = null;
                }
            }
            catch
            {
                //MessageBox.Show(ex.Message);
            }
        }


-------------------------------

 public static void genReport(DataTable dtReport, string compName, string compDetails)
        {
            if (dtReport != null && dtReport.Rows.Count > 0)
            {
                string fileName = Common.strPathExcelReport;
                if (string.IsNullOrEmpty(fileName))
                {
                    Common.MsgBox(MessageType.ForInvalidFile);
                    return;
                }
                string logoFile = Common.strPathExcelReportLogo;
                string ProjectName = "";
                ProjectName = "";
                cls_GenExcel.exportExcel(dtReport, fileName, logoFile, compName, ProjectName, compDetails);
                FileDownload fileDownload = new FileDownload(fileName, Common.ReadExcel(fileName), FilePath.FileNameWithExtension);
            }
            else
            {
                MessageBox.Show("No Data Found. Report Couldn't Generated...");
            }
        }

2012/11/19

How to work Background Worker

 BackgroundLoading.cs
----------------------------------------------------------
public class BackgroundLoading
    {
        public delegate void RunFunction();

        public BackgroundWorker Bw;
        public RunFunction thisFunction;
        FrmLoding newLoading;

        public BackgroundLoading(RunFunction newFunction)
        {
            try
            {
                System.Threading.ThreadStart ts = new System.Threading.ThreadStart(ExpansiveMethod);
                System.Threading.Thread t = new System.Threading.Thread(ts);
                t.Start();

                thisFunction = newFunction;
                Bw = new BackgroundWorker();
                Bw.DoWork += new DoWorkEventHandler(Bw_DoWork);
                Bw.RunWorkerCompleted += new RunWorkerCompletedEventHandler(Bw_RunWorkerCompleted);
            }
            catch (Exception ex)
            {
                throw;
            }
        }

        public void Start()
        {
            try
            {
              
                Bw.RunWorkerAsync();               
                newLoading = new FrmLoding();
                newLoading.ShowDialog();
              
            }
            catch (Exception ex)
            {
                throw;
            }
        }
        protected void ExpansiveMethod()
        {
            //Very expansive call will go here...
            //after the job is finished call method to update ui
            MethodInvoker updaterMI = new MethodInvoker(UpdateChange);
            this.UpdateChange();
        }
        protected void UpdateChange()
        {
            //again back to main ui thread
        }
        void Bw_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
        {
            try
            {
                newLoading.Close();
                ExpansiveMethod();

            }
            catch (Exception ex)
            {
                throw;
            }
        }


        void Bw_DoWork(object sender, DoWorkEventArgs e)
        {
            try
            {
                if (thisFunction != null)
                {
                    thisFunction();
                }
            }
            catch (Exception ex)
            {
                throw;
            }
        }
    }

--------------------------------------WPF Control............................LoadingAnimation.xmal
<UserControl x:Class="VISION.LoadingAnimation"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:VISION"
    Height="Auto" Width="Auto">
    <UserControl.Resources>
        <Storyboard x:Key="ProgressAnimation" RepeatBehavior="Forever">
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#00000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block17" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="Black"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block16" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#EF000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block15" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#E2000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block14" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#D3000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block13" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#C6000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block12" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#B7000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block11" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#AA000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block10" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#23000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#9B000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block9" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#91000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block8" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#91000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#7F000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block7" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#91000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#72000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block6" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#91000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#63000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block5" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#91000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#56000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block4" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#91000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#3D000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block3" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#91000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#26000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block2" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#0C000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#91000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#19000000"/>
            </ColorAnimationUsingKeyFrames>
            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="block1" Storyboard.TargetProperty="(UIElement.OpacityMask).(SolidColorBrush.Color)">
                <SplineColorKeyFrame KeyTime="00:00:00" Value="#00000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.2290000" Value="Black"/>
                <SplineColorKeyFrame KeyTime="00:00:00.4590000" Value="#EF000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.6880000" Value="#E2000000"/>
                <SplineColorKeyFrame KeyTime="00:00:00.9180000" Value="#D3000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.1470000" Value="#C6000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.3760000" Value="#B7000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.6060000" Value="#AA000000"/>
                <SplineColorKeyFrame KeyTime="00:00:01.8350000" Value="#9B000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.0650000" Value="#8E000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.2940000" Value="#7F000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.5240000" Value="#72000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.7530000" Value="#63000000"/>
                <SplineColorKeyFrame KeyTime="00:00:02.9820000" Value="#56000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.2120000" Value="#3D000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.4410000" Value="#26000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.6710000" Value="#19000000"/>
                <SplineColorKeyFrame KeyTime="00:00:03.9000000" Value="#0C000000"/>
            </ColorAnimationUsingKeyFrames>
        </Storyboard>
    </UserControl.Resources>
    <UserControl.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard x:Name="ProgressAnimation_BeginStoryboard" Storyboard="{StaticResource ProgressAnimation}"/>
        </EventTrigger>
    </UserControl.Triggers>

    <Canvas x:Name="LayoutRoot" VerticalAlignment="Top" Height="70" Width="70">
        <TextBlock Text="Loading..." TextWrapping="Wrap" Canvas.Left="20.069" Canvas.Top="36.214"/>
        <Grid Width="10.734" Height="10.004" Canvas.Left="38.614" Canvas.Top="0.331">
            <local:Block x:Name="block" RenderTransformOrigin="0.5,4.3689" OpacityMask="#00000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="180"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block1" RenderTransformOrigin="0.5,4.3689" OpacityMask="#0C000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="-160"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block2" RenderTransformOrigin="0.5,4.3689" OpacityMask="#19000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="-140"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block3" RenderTransformOrigin="0.5,4.3689" OpacityMask="#26000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="-119.99999999999999"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block4" RenderTransformOrigin="0.5,4.3689" OpacityMask="#3D000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="-100"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block5" RenderTransformOrigin="0.5,4.3689" OpacityMask="#56000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="-80"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block6" RenderTransformOrigin="0.5,4.3689" OpacityMask="#64000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="-59.999999999999993"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block7" RenderTransformOrigin="0.5,4.3689" OpacityMask="#72000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="-40"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block8" RenderTransformOrigin="0.5,4.3689" OpacityMask="#80000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="-19.999999999999996"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block9" OpacityMask="#8E000000" RenderTransformOrigin="0.5,4.3689" VerticalAlignment="Top" Height="10.004"/>
            <local:Block x:Name="block10" RenderTransformOrigin="0.5,4.3689" OpacityMask="#9C000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="19.999999999999996"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block11" RenderTransformOrigin="0.5,4.3689" OpacityMask="#AA000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="40"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block12" RenderTransformOrigin="0.5,4.3689" OpacityMask="#B8000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="59.999999999999993"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block13" RenderTransformOrigin="0.5,4.3689" OpacityMask="#C6000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="80"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block14" RenderTransformOrigin="0.5,4.3689" OpacityMask="#D4000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="100"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block15" RenderTransformOrigin="0.5,4.3689" OpacityMask="#E2000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="119.99999999999999"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block16" RenderTransformOrigin="0.5,4.3689" OpacityMask="#F0000000" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform Angle="140"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
            <local:Block x:Name="block17" RenderTransformOrigin="0.5,4.3689" OpacityMask="Black" VerticalAlignment="Top" Height="10.004">
                <local:Block.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform ScaleX="0.99999999999999989" ScaleY="0.99999999999999989"/>
                        <SkewTransform/>
                        <RotateTransform Angle="160"/>
                        <TranslateTransform/>
                    </TransformGroup>
                </local:Block.RenderTransform>
            </local:Block>
        </Grid>
    </Canvas>
</UserControl>

--------------------------Block
<UserControl x:Class="VISION.Block"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Height="Auto" Width="Auto">
    <Grid x:Name="LayoutRoot">
        <Path Fill="#FF5482A1" Stretch="Fill" RenderTransformOrigin="0.5,4.3689" Data="M291.15499,85.897525 C291.15499,85.897525 301.88917,85.87921 301.88917,85.87921 301.88917,85.87921 300.38339,94.355061 300.38339,94.355061 300.38339,94.355061 292.85366,94.355042 292.85366,94.355042 292.85366,94.355042 291.15499,85.897525 291.15499,85.897525 z"/>
    </Grid>
</UserControl>
--------------------------------
>iske alava or gana nhi ha kaya

------------------call function----------
 BackgroundLoading BL = new BackgroundLoading(Test);
 BL.Start();