void convert_keyframe_value_cb (Kind kind, IntPtr property_ptr, IntPtr original, out Value converted)
{
Type type = Deployment.Current.Types.KindToType (kind);
if (type != null)
Types.Ensure (type);
DependencyProperty property = DependencyProperty.Lookup (property_ptr);
if (property == null) {
Console.WriteLine ("Moonlight Error: Property couldn't be looked up");
converted = Value.Empty;
return;
}
object o = Value.ToObject (null, original);
if (o == null) {
Console.WriteLine ("Moonlight Error: Object was null");
converted = Value.Empty;
return;
}
o = MoonlightTypeConverter.ConvertObject (property, o, null, true);
if (o == null) {
Console.WriteLine ("Moonlight Error: Converted to null");
converted = Value.Empty;
return;
}
// This is freed in native code
converted = Value.FromObject (o);
}