FirstFloor.ModernUI.Windows.Controls.PlaceholderTextBlock.SetPlaceholder C# (CSharp) Method

SetPlaceholder() protected method

protected SetPlaceholder ( ) : void
return void
        protected void SetPlaceholder() {
            Inlines.Clear();
            var placeholder = Placeholder;
            if (!string.IsNullOrEmpty(placeholder)) {
                var inline = new Run { Text = placeholder };
                inline.SetBinding(TextElement.ForegroundProperty, new Binding {
                    Path = new PropertyPath(nameof(Foreground)),
                    Source = this,
                    Converter = this
                });
                Inlines.Add(inline);
            }
        }