/// <summary> /// Notifies the <see cref="FocusStateChanged"/> event listeners. /// </summary> /// <param name="args">The <see cref="FocusStateChangedEventArgs"/> instance containing the event data.</param> private void NotifyFocusStateChanged(FocusStateChangedEventArgs args) { EventHandler <FocusStateChangedEventArgs> handler = this.FocusStateChanged; if (handler != null) { handler.Invoke(this, args); } }
/// <summary> /// The <see cref="MainPageViewModel.FocusStateChanged"/> event handler. /// </summary> /// <param name="sender">Event sender.</param> /// <param name="e">The <see cref="FocusStateChangedEventArgs"/> instance containing the event data.</param> private void ViewModelOnFocusStateChanged(object sender, FocusStateChangedEventArgs e) { DispatcherHelper.BeginInvokeOnUIThread(() => { switch (e.FocusState) { case FocusState.Focusing: if (this.viewfinder != null) { if (e.FocusPoint.HasValue) { this.viewfinder.FlashPointFocusBrackets(e.FocusPoint.Value); } else { this.viewfinder.FlashAutoFocusBrackets(); } } break; case FocusState.Locked: if (this.viewfinder != null) { if (e.FocusPoint.HasValue) { this.viewfinder.LockTouchFocusBrackets(); } else { this.viewfinder.LockAutoFocusBrackets(); } } break; case FocusState.Unlocked: if (this.viewfinder != null) { this.viewfinder.DismissFocusBrackets(); } break; } }); }
/// <summary> /// Notifies the <see cref="FocusStateChanged"/> event listeners. /// </summary> /// <param name="args">The <see cref="FocusStateChangedEventArgs"/> instance containing the event data.</param> private void NotifyFocusStateChanged(FocusStateChangedEventArgs args) { EventHandler<FocusStateChangedEventArgs> handler = this.FocusStateChanged; if (handler != null) { handler.Invoke(this, args); } }