Example #1
0
        private void OnSourceChanged()
        {
            var textBlock = AssociatedObject;

            if (textBlock != null && Source != null)
            {
                if (StringFormat.HasValue())
                {
                    var content = string.Format(StringFormat, Source);
                    textBlock.SetValue(TextBlock.TextProperty, content);
                }
                else
                {
                    textBlock.SetValue(TextBlock.TextProperty, Source.ToString());
                }
            }
        }