MonoMobile.Views.ListSource.Dispose C# (CSharp) Method

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (MemberData != null)
				{
					MemberData.Dispose();
					MemberData = null;
				}

				if (CellId != null)
				{
					CellId.Dispose();
				}
				
				if (NavigationView != null)
				{
					var disposable = NavigationView as IDisposable;
					if (disposable != null)
					{
						disposable.Dispose();
						NavigationView = null;
					}
				}

				if (NavigationSource != null)
				{
					NavigationSource.Dispose();
					NavigationSource = null;
				}
	
				//TODO: Should this be disposed here??
				foreach(var section in Sections.Values)
				{
					var disposable = section.DataContext as IDisposable;
					if (disposable != null)
					{
						disposable.Dispose();
					}
				}
			}

			base.Dispose(disposing);
		}