Skip to content

Creating a dynamic via ViewData.CreateView<T> is not working #68

Description

@khalilovcmd

This doesn't work:

ViewData.LoadXuml ("<MyExample>\n<Panel>\n \n</Panel>\n</MyExample>", "MyExample");
ViewData.CreateView<MyExample> ( this.LayoutParent, Parent);

In class ViewData.cs, function LoadViewXuml, we are:

var viewTypeData = new ViewTypeData();
viewPresenter.ViewTypeDataList.Add(viewTypeData);

Then when creating a view, we try in class ViewPresenter.cs function GetViewTypeData:

if (_viewTypeDataDictionary == null )
{
  LoadViewTypeDataDictionary();
}

ViewTypeData viewTypeData;
if (!_viewTypeDataDictionary.TryGetValue(viewTypeName, out viewTypeData))
{
  Debug.LogError(String.Format("[MarkLight] Can't find view type \"{0}\".", viewTypeName));
                return null;
}

So I believe this was recently introduced for performance improvements, but _viewTypeDataDictionary is not going to have all the records as ViewTypeDataList in both need to be synchronised.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions