using System.Linq;
using System.Reflection;

namespace Inspectron.Settings.Avalonia
{
    public static class PropHelper
    {
        public static PropertyInfo GetPrp(object obj, string name)
        {
            return obj.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance)
                .First(x => x.Name == name);
        }
        public static string SplitCamelCase(string input)
        {
            return System.Text.RegularExpressions.Regex.Replace(input, "([A-Z])", " $1", System.Text.RegularExpressions.RegexOptions.Compiled).Trim();
        }
    }
}
