return Header;
}
- if (index == InternalSource.Count - 1 && Footer != null)
+ var source = InternalSource;
+ if (source == null)
+ return null;
+
+ if (index == source.Count - 1 && Footer != null)
{
Footer.Show();
return Footer;
if (isGrouped)
{
- var context = InternalSource.GetItem(index);
- if (InternalSource.IsGroupHeader(index))
+ if (source.IsGroupHeader(index))
{
+ var context = source.GetItem(index);
item = RealizeGroupHeader(index, context);
}
- else if (InternalSource.IsGroupFooter(index))
+ else if (source.IsGroupFooter(index))
{
-
+ var context = source.GetItem(index);
//group selection?
item = RealizeGroupFooter(index, context);
}
{
throw new Exception("Item realize failed by Null content return.");
}
- item.ParentGroup = InternalSource.GetGroupParent(index);
+ item.ParentGroup = source.GetGroupParent(index);
}
}
else
{
Vector3 temp = GetNaturalSize();
if (NDalicPINVOKE.SWIGPendingException.Pending) throw new InvalidOperationException("FATAL: get Exception", NDalicPINVOKE.SWIGPendingException.Retrieve());
-
- Size2D sz = new Size2D((int)temp.Width, (int)temp.Height);
- temp.Dispose();
+ Size2D sz = null;
+ if (temp != null)
+ {
+ sz = new Size2D((int)temp.Width, (int)temp.Height);
+ temp.Dispose();
+ }
return sz;
}
}