1

I use this lib : http://winrtxamltoolkit.codeplex.com/ I want to specify the FontSize of the WatermarkText, how can I do that ?

Thanks

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
Roroto
  • 91
  • 2
  • 6

1 Answers1

2

You can use the Watermark property instead of the WatermarkText one to put anything you want as your watermark - e.g. a TextBlock with any properties you want. You can also use the WatermarkTextStyle property when using WatermarkText and specify the Style to use with the provided watermark TextBlock - something like:

<xc:WatermarkTextBox
    WatermarkText="Type something">
    <xc:WatermarkTextBox.WatermarkTextStyle>
        <Style
            TargetType="TextBlock">
            <Setter
                Property="FontSize"
                Value="18" />
            ...

You can check the sample to see some options here.

Filip Skakun
  • 31,624
  • 6
  • 74
  • 100
  • Thanks for your answer. Is a bit strange because when i use I have this error : Error 8 the property attached to 'WatermarkTextStyle' can't be found on the type 'WatermarkTextBox'. In my xaml page because I already have a datacontext i put this at the top : xmlns:ctl="using:WinRTXamlToolkit.Controls" xmlns:Extensions="using:WinRTXamlToolkit.Controls.Extensions" maybe because of that it doesn't work ? (of course I modify the xc by ctl) – Roroto Mar 20 '13 at 15:27
  • Does the project build though? The designer/xaml editor often reports false errors. – Filip Skakun Mar 20 '13 at 15:50
  • No, can't compile. 3 errors : the member "WatermarkTextStyle" is unreconized or not accessible. and two linked to this error – Roroto Mar 21 '13 at 08:53
  • Maybe you are using an older version of the toolkit. If you look at the sample it does exactly that – Filip Skakun Mar 21 '13 at 14:15
  • Download latest source. It might be more up to date. – Filip Skakun Mar 21 '13 at 18:24