Ejemplo n.º 1
0
        private static void OnIsVisibilityPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            ToolTips tip = d as ToolTips;

            if (tip != null)
            {
                bool str = (bool)e.NewValue;
                //根据传值判断是否显示该提示控件
                if (!str)
                {
                    tip.LayoutRoot.Visibility = Visibility.Collapsed;
                    tip.LayoutRoot.Opacity    = 0.0;
                }
                else
                {
                    tip.LayoutRoot.Visibility = Visibility.Visible;
                    tip.LayoutRoot.Opacity    = 1.0;
                }
            }
        }