public void OnTopPassed(IViewPortCalculation calculation) { Calculation = calculation; var eventArgs = new ViewPortEventArgs(calculation); if (OnTopPassedUpdated != null) { OnTopPassedUpdated?.Invoke(eventArgs); } }
///<inheritdoc/> protected override void OnAfterRender(bool firstRender) { base.OnAfterRender(firstRender); if (firstRender) { lazyAnimator = new Lazy <FomanticComponentAnimator <FomanticComponentBase> >(() => new FomanticComponentAnimator <FomanticComponentBase>(this)); lazyViewportVisibility = new Lazy <ViewportVisibility>(() => { var x = new ViewportVisibility(() => RootElement, JsRuntime); #region Viewport Visibility Events if (OnViewportVisibilityUpdatedEvent != null) { x.OnVisibilityUpdated += OnViewportVisibilityUpdatedEvent; } if (OnViewportVisibilityUpdated.HasDelegate) { x.OnVisibilityUpdated += d => OnViewportVisibilityUpdated.InvokeAsync(d); } if (OnTopVisibilityUpdatedEvent != null) { x.OnTopVisibleUpdated += OnTopVisibilityUpdatedEvent; } if (OnTopVisibilityUpdated.HasDelegate) { x.OnTopVisibleUpdated += d => OnTopVisibilityUpdated.InvokeAsync(d); } if (OnTopPassedUpdatedEvent != null) { x.OnTopPassedUpdated += OnTopPassedUpdatedEvent; } if (OnTopPassedUpdated.HasDelegate) { x.OnTopPassedUpdated += d => OnTopPassedUpdated.InvokeAsync(d); } if (OnBottomVisibleUpdatedEvent != null) { x.OnBottomVisibleUpdated += OnBottomVisibleUpdatedEvent; } if (OnBottomVisibleUpdated.HasDelegate) { x.OnBottomVisibleUpdated += d => OnBottomVisibleUpdated.InvokeAsync(d); } if (OnPassingUpdatedEvent != null) { x.OnPassingUpdated += OnPassingUpdatedEvent; } if (OnPassingUpdated.HasDelegate) { x.OnPassingUpdated += d => OnPassingUpdated.InvokeAsync(d); } if (OnBottomPassedUpdatedEvent != null) { x.OnBottomPassedUpdated += OnBottomPassedUpdatedEvent; } if (OnBottomPassedUpdated.HasDelegate) { x.OnBottomPassedUpdated += d => OnBottomPassedUpdated.InvokeAsync(d); } if (OnTopVisibleReverseUpdatedEvent != null) { x.OnTopVisibleReverseUpdated += OnTopVisibleReverseUpdatedEvent; } if (OnTopVisibleReverseUpdated.HasDelegate) { x.OnTopVisibleReverseUpdated += d => OnTopVisibleReverseUpdated.InvokeAsync(d); } if (OnTopPassedReverseUpdatedEvent != null) { x.OnTopPassedReverseUpdated += OnTopPassedReverseUpdatedEvent; } if (OnTopPassedReverseUpdated.HasDelegate) { x.OnTopPassedReverseUpdated += d => OnTopPassedReverseUpdated.InvokeAsync(d); } if (OnBottomVisibleReverseUpdatedEvent != null) { x.OnBottomVisibleReverseUpdated += OnBottomVisibleReverseUpdatedEvent; } if (OnBottomVisibleReverseUpdated.HasDelegate) { x.OnBottomVisibleReverseUpdated += d => OnBottomVisibleReverseUpdated.InvokeAsync(d); } if (OnPassingReverseUpdatedEvent != null) { x.OnPassingReverseUpdated += OnPassingReverseUpdatedEvent; } if (OnPassingReverseUpdated.HasDelegate) { x.OnPassingReverseUpdated += d => OnPassingReverseUpdated.InvokeAsync(d); } if (OnBottomPassedReverseUpdatedEvent != null) { x.OnBottomPassedReverseUpdated += OnBottomPassedReverseUpdatedEvent; } if (OnBottomPassedReverseUpdated.HasDelegate) { x.OnBottomPassedReverseUpdated += d => OnBottomPassedReverseUpdated.InvokeAsync(d); } #endregion x.Apply(); return(x); }); } }