Articles in this section
Category / Section

How to set Foreground color for Watermark text in SfTextBoxExt?

1 min read

In SfTextBoxExt, the foreground color of the watermark text can be changed by using the Watermark Template.


<Input:SfTextBoxExt Name="sftextbox"  AutoCompleteMode="Suggest"  
   AutoCompleteSource="{Binding AutoCompleteSource, Mode=TwoWay}">
            <TextBlock Text="Type S to Start" Foreground="Green"/>


public sealed partial class MainPage : Page
        public MainPage()
            var str = "<DataTemplate xmlns=\"\">" +
                 "<TextBlock Text=\"Type S to Start\" Foreground=\"Green\" />" +
            DataTemplate template = (DataTemplate)Windows.UI.Xaml.Markup.XamlReader.Load(str);
            sftextbox.WatermarkTemplate = template;
           Collection c = new Collection();
            this.DataContext = c;            
   public class Collection
            public List<string> AutoCompleteSource
                    return new List<string>() { "Sam", "Sarvan", "Stephen" };

The following screenshot shows the applied foreground color on Watermark text in SfTextBoxExt.


Figure 1: Output

Did you find this information helpful?
Help us improve this page
Please provide feedback or comments
Comments (0)
Please  to leave a comment
Access denied
Access denied