Exemplo n.º 1
0
            private static void OnLabelTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
            {
                BalloonBox balloonBox = (BalloonBox)d;

                if (e.NewValue == null || string.IsNullOrEmpty(e.NewValue.ToString()))
                {
                    if (balloonBox.headerTextBlock != null)
                    {
                        balloonBox.headerTextBlock.Foreground = new SolidColorBrush(Colors.Gray);
                    }
                    if (balloonBox.headerTextBlock != null)
                    {
                        balloonBox.headerTextBlock.Text = balloonBox.WaterMark;
                    }
                }
                else
                {
                    if (balloonBox.headerTextBlock != null)
                    {
                        balloonBox.headerTextBlock.Foreground = new SolidColorBrush(Colors.Black);
                    }
                    if (balloonBox.headerTextBlock != null)
                    {
                        balloonBox.headerTextBlock.Text = e.NewValue.ToString().Replace("\n", " ").Replace("\r", " ");
                    }
                }
            }
Exemplo n.º 2
0
            private static void OnIsOpenChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
            {
                BalloonBox balloonBox = (BalloonBox)d;

                balloonBox.popUp.IsOpen = (bool)e.NewValue;
            }