You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
3.5 KiB
66 lines
3.5 KiB
<!--*********************************************************************
|
|
|
|
Extended WPF Toolkit
|
|
|
|
Copyright (C) 2010-2012 Xceed Software Inc.
|
|
|
|
This program is provided to you under the terms of the Microsoft Reciprocal
|
|
License (Ms-RL) as published at http://wpftoolkit.codeplex.com/license
|
|
|
|
This program can be provided to you by Xceed Software Inc. under a
|
|
proprietary commercial license agreement for use in non-Open Source
|
|
projects. The commercial version of Extended WPF Toolkit also includes
|
|
priority technical support, commercial updates, and many additional
|
|
useful WPF controls if you license Xceed Business Suite for WPF.
|
|
|
|
Visit http://xceed.com and follow @datagrid on Twitter.
|
|
|
|
********************************************************************-->
|
|
<sample:DemoView x:Class="Samples.Modules.Text.Views.WatermarkTextBoxView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:sample="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure"
|
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
|
|
Title="WatermarkTextBox">
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="Auto" />
|
|
<RowDefinition Height="*" />
|
|
</Grid.RowDefinitions>
|
|
|
|
<TextBlock Text="The WatermarkTextBox is simply a TextBox that allows you to sepcify an object, usually a String, to represent null or missing text." />
|
|
|
|
<GroupBox Header="Features" Grid.Row="1">
|
|
<Grid Margin="5">
|
|
<CheckBox x:Name="_selectAll" Content="SelectAllOnGotFocus" VerticalAlignment="Center" Margin="5" ToolTip="Selects all text in the WatermarkTextBox when it receives focus." />
|
|
</Grid>
|
|
</GroupBox>
|
|
|
|
<StackPanel Grid.Row="2" Margin="10">
|
|
<TextBlock Text="Default:" Style="{StaticResource Header}" />
|
|
<xctk:WatermarkTextBox Grid.Column="1" Margin="5" MinWidth="200" Watermark="Enter Text" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}" />
|
|
|
|
<TextBlock Text="Image Watermark:" Style="{StaticResource Header}" />
|
|
<xctk:WatermarkTextBox Grid.Column="1" Margin="5" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}">
|
|
<xctk:WatermarkTextBox.Watermark>
|
|
<StackPanel Orientation="Horizontal">
|
|
<Image Source="/Samples.Modules.Text;component/Images/PencilTool16.png" Stretch="None" />
|
|
<TextBlock Text="Enter Text" Margin="4,0,0,0" />
|
|
</StackPanel>
|
|
</xctk:WatermarkTextBox.Watermark>
|
|
</xctk:WatermarkTextBox>
|
|
|
|
<TextBlock Grid.Row="2" Text="Custom WatermarkTemplate:" Style="{StaticResource Header}" />
|
|
<xctk:WatermarkTextBox Grid.Row="2" Grid.Column="1" Margin="5" Watermark="Enter Text" SelectAllOnGotFocus="{Binding IsChecked, ElementName=_selectAll}">
|
|
<xctk:WatermarkTextBox.WatermarkTemplate>
|
|
<DataTemplate>
|
|
<Border BorderBrush="Green" BorderThickness="1" Padding="5">
|
|
<ContentControl Content="{Binding}" Foreground="DarkRed" FontWeight="Bold" Focusable="False" />
|
|
</Border>
|
|
</DataTemplate>
|
|
</xctk:WatermarkTextBox.WatermarkTemplate>
|
|
</xctk:WatermarkTextBox>
|
|
</StackPanel>
|
|
</Grid>
|
|
</sample:DemoView>
|
|
|