protected void SetBinding(ListView listView, BindingExtensions.SerializedObjectUpdateWrapper objWrapper, SerializedProperty prop) { boundObject = objWrapper; boundProperty = prop; boundPropertyPath = prop.propertyPath; m_DataList = new SerializedObjectList(prop, true); m_ArraySize = m_DataList.ArraySize; m_ListViewArraySize = m_DataList.ArraySize.intValue; this.listView = listView; if (listView.makeItem == null) { listView.makeItem = () => MakeListViewItem(); } if (listView.bindItem == null) { listView.bindItem = (v, i) => BindListViewItem(v, i); } listView.itemsSource = m_DataList; }
public static void CreateBind(ListView listView, BindingExtensions.SerializedObjectUpdateWrapper objWrapper, SerializedProperty prop) { var newBinding = new ListViewSerializedObjectBinding(); newBinding.SetBinding(listView, objWrapper, prop); }