public static TResult LoadUserInterfaceFromAutoViewModel <TBuildable, TResult>(
            this IMvxAutoView view, string key)
            where TResult : class
        {
            var autoViewModel = view.ViewModel as IMvxAutoViewModel;

            var description = autoViewModel?.GetAutoView(key);

            if (description == null)
            {
                return(null);
            }

            return(view.LoadUserInterfaceFromDescription <TBuildable, TResult>(description));
        }
        private static TResult LoadUserInterfaceFromJsonText <TDescription, TBuildable, TResult>(
            this IMvxAutoView view, string jsonText)
            where TDescription : KeyedDescription
        {
            if (string.IsNullOrEmpty(jsonText))
            {
                return(default(TResult));
            }

            var json        = Mvx.Resolve <IMvxJsonConverter>();
            var description = json.DeserializeObject <TDescription>(jsonText);

#warning Hack here - how to flatten these JObjects :/ Maybe need to do it inside the Json converter?
            //HackFlattenJObjectsToStringDictionary(description as ListLayoutDescription);
            var root = view.LoadUserInterfaceFromDescription <TBuildable, TResult>(description);
            return(root);
        }
 public static TRoot LoadDialogRoot <TElement, TRoot>(this IMvxAutoView view,
                                                      ElementDescription rootDescription)
 {
     return(view.LoadUserInterfaceFromDescription <TElement, TRoot>(rootDescription));
 }