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

Dispose() protected method

protected Dispose ( bool disposing ) : void
disposing bool
return void
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				Id.Dispose();

				if (DataContextBinder != null)
				{
					DataContextBinder = null;
				}
				
				RemoveNotifyPropertyChangedHandler(Source, this);
				RemoveNotifyPropertyChangedHandler(DataContextSource, this);

				RemoveNotifyCollectionChangedHandler(Source, this);
				RemoveNotifyCollectionChangedHandler(DataContextSource, this);
			}
			
			base.Dispose(disposing);
		}

Usage Example

Exemplo n.º 1
0
        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);
        }
All Usage Examples Of MonoMobile.Views.MemberData::Dispose