public static void SetDisableSearchPaneOnFocusHandler(DependencyObject d, DisableSearchPaneOnFocusHandler value)
 {
     d.SetValue(DisableSearchPaneOnFocusHandlerProperty, value);
 }
        /// <summary>
        /// Handles changes to the DisableSearchPaneOnFocus property.
        /// </summary>
        /// <param name="d">
        /// The <see cref="DependencyObject"/> on which
        /// the property has changed value.
        /// </param>
        /// <param name="e">
        /// Event data that is issued by any event that
        /// tracks changes to the effective value of this property.
        /// </param>
        private static void OnDisableSearchPaneOnFocusChanged(
            DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
#if WINDOWS_APP
            bool newDisableSearchPaneOnFocus = (bool)d.GetValue(DisableSearchPaneOnFocusProperty);

            var handler = GetDisableSearchPaneOnFocusHandler(d);

            if (handler != null)
            {
                handler.Detach();
                SetDisableSearchPaneOnFocusHandler(d, null);
            }

            if (newDisableSearchPaneOnFocus)
            {
                handler = new DisableSearchPaneOnFocusHandler((TextBox)d);
                SetDisableSearchPaneOnFocusHandler(d, handler);
            }
#endif
        }