I want to fully copy a control in maui .How can i do that .I tried the following code but it returns error
I tried this to copy an control :
using System.Reflection;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace CrossPlatformLibrary.CSExtended.CSESystem
{
public class CSEObject
{
public object ShallowCopy(object o)
{
return o?.GetType().GetMethod("MemberwiseClone", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(o, null);
}
public object Copy(object o)
{
return DeepCopy(o);
}
public static object DeepCopy(object o)
{
JsonSerializerOptions jsonOptions;
jsonOptions = new JsonSerializerOptions();
jsonOptions.Converters.Add(new JsonStringEnumConverter());
var json = JsonSerializer.Serialize(o, jsonOptions);
return JsonSerializer.Deserialize(json, o.GetType(), jsonOptions);
}
}
}
but it threw exception :
System.NotImplementedException