Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Controls:TextBoxHelper.UseFloatingWatermark="True" work for DatePicker #2269

Closed
FilippoVigani opened this issue Dec 12, 2015 · 1 comment
Milestone

Comments

@FilippoVigani
Copy link

It would be cool if the option in TextBoxHelper.UseFloatingWatermark worked on DatePicker. Any way to make it work in case you don't plan to make it a functionality?
floatingwatermark

As a temporary workaround I created a simple style to achieve what I'd like:

<Style TargetType="{x:Type DatePickerTextBox}"
                   BasedOn="{StaticResource {x:Type DatePickerTextBox}}">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <TextBox Controls:TextBoxHelper.Watermark="{Binding Path=(Controls:TextBoxHelper.Watermark),RelativeSource={RelativeSource TemplatedParent}}"
                                     Controls:TextBoxHelper.UseFloatingWatermark="True"
                                     VerticalContentAlignment="Center"
                                     Text="{Binding Text, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}"
                                     BorderThickness="0"
                                     Padding="0" />
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

result

@punker76 punker76 added this to the 1.3.0 milestone Jun 16, 2016
@punker76
Copy link
Member

@VeegaP available now after this 94b2a09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants