﻿function GetKeyFrameXaml(property, first, keyFrame)
{
    ///<summary>Get the XAML for a Key Frame</summary>
    ///<param name="property" type="String">the name of the property to get</param>
    ///<param name="first" type="Boolean">true if this is the first key frame</param>
    ///<param name="keyFrame">the key frame object</param>
    ///<return type="string">the XAML</return>
    var xaml = '\t\t\t';
    if (first)
    {
        xaml+= '<DiscreteDoubleKeyFrame ';
    }
    else
    {
        xaml+= '<LinearDoubleKeyFrame ';
    }
    
    xaml+=  'KeyTime="' + formatTime(keyFrame.TimeCode) + '" Value="';
    
    switch(property)
    {
    case "Canvas.Left":
        xaml+=keyFrame.Left;
        break;
    case "Canvas.Top":
        xaml+=keyFrame.Top;
        break;
    case "Width":
        xaml+=keyFrame.Width;
        break;
    case "Height":
        xaml+=keyFrame.Height;
        break;
    }
    
    xaml += '"/>\n';
    
    return xaml;
}
