protected override void Dispose(bool disposing) { if (_disposed) { return; } if (disposing) { if (_formsCell != null) { _formsCell.PropertyChanged -= CellPropertyChanged; } CustomCell = null; _heightConstraint?.Dispose(); _heightConstraint = null; IVisualElementRenderer renderer = null; if (_rendererRef != null && _rendererRef.TryGetTarget(out renderer) && renderer.Element != null) { FormsInternals.DisposeModelAndChildrenRenderers(renderer.Element); _rendererRef = null; } renderer?.Dispose(); _formsCell = null; } _disposed = true; base.Dispose(disposing); }
private void UpdateIconSize() { Size size; if (CellBase.IconSize != default(Size)) { size = CellBase.IconSize; } else if (CellParent != null && CellParent.CellIconSize != default(Size)) { size = CellParent.CellIconSize; } else { size = new Size(32, 32); } //do nothing when current size is previous size if (size == _iconSize) { return; } if (_iconSize != default(Size)) { //remove previous constraint _iconConstraintHeight.Active = false; _iconConstraintWidth.Active = false; _iconConstraintHeight?.Dispose(); _iconConstraintWidth?.Dispose(); } _iconConstraintHeight = IconView.HeightAnchor.ConstraintEqualTo((nfloat)size.Height); _iconConstraintWidth = IconView.WidthAnchor.ConstraintEqualTo((nfloat)size.Width); _iconConstraintHeight.Priority = 999f; // fix warning-log:Unable to simultaneously satisfy constraints. _iconConstraintHeight.Active = true; _iconConstraintWidth.Active = true; IconView.UpdateConstraints(); _iconSize = size; }
public override void ViewDidMoveToSuperview() { base.ViewDidMoveToSuperview(); if (Superview != null) { superHeightConstraint = Superview.HeightAnchor.ConstraintEqualToConstant(Frame.Height); superWidthConstraint = Superview.WidthAnchor.ConstraintEqualToConstant(Frame.Width); superHeightConstraint.Active = true; superWidthConstraint.Active = true; } else { superHeightConstraint?.Dispose(); superWidthConstraint?.Dispose(); superHeightConstraint = null; superWidthConstraint = null; } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing) { _mentionsTable.Dispose(); _mentionsTable = null; _source.Dispose(); _source = null; _mentionsTableTopConstraint.Dispose(); _mentionsTable = null; } }
protected override void Dispose(bool disposing) { if (disposing && !disposed) { //PreviewWindowManager.WindowClosed -= PreviewWindowManager_WindowClosed; treeView.Resized -= OnTreeViewResized; treeView.NodePinned -= OnPinStatusChanged; treeView.StartEditing -= OnStartEditing; treeView.EndEditing -= OnEndEditing; heightConstraint.Dispose(); widthConstraint.Dispose(); } base.Dispose(disposing); }
void UpdateMinRowHeight() { if (_minheightConstraint != null) { _minheightConstraint.Active = false; _minheightConstraint.Dispose(); _minheightConstraint = null; } if (CellParent.HasUnevenRows) { _minheightConstraint = _stackH.HeightAnchor.ConstraintGreaterThanOrEqualTo(CellParent.RowHeight); _minheightConstraint.Active = true; } _stackH.UpdateConstraints(); }
protected override void Dispose(bool disposing) { if (disposing && !disposed) { DebuggingService.ResumedEvent -= OnDebuggerResumed; DebuggingService.PausedEvent -= OnDebuggerPaused; treeView.Resized -= OnTreeViewResized; superHeightConstraint?.Dispose(); superWidthConstraint?.Dispose(); superHeightConstraint = null; superWidthConstraint = null; heightConstraint.Dispose(); widthConstraint.Dispose(); disposed = true; } base.Dispose(disposing); }