10 changed files with 89 additions and 1 deletions
|
After Width: | Height: | Size: 348 B |
@ -0,0 +1,41 @@ |
|||
<infControls: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:infControls="clr-namespace:Samples.Infrastructure.Controls;assembly=Samples.Infrastructure" |
|||
xmlns:extToolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit/extended" |
|||
Title="WatermarkTextBox"> |
|||
<Grid> |
|||
<Grid.RowDefinitions> |
|||
<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." /> |
|||
|
|||
<StackPanel Grid.Row="1" Margin="10"> |
|||
<TextBlock Text="Default:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Column="1" Margin="5" Watermark="Enter Text" /> |
|||
|
|||
<TextBlock Text="Image Watermark:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Column="1" Margin="5" > |
|||
<extToolkit: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> |
|||
</extToolkit:WatermarkTextBox.Watermark> |
|||
</extToolkit:WatermarkTextBox> |
|||
|
|||
<TextBlock Grid.Row="2" Text="Custom WatermarkTemplate:" Style="{StaticResource Header}" /> |
|||
<extToolkit:WatermarkTextBox Grid.Row="2" Grid.Column="1" Margin="5" Watermark="Enter Text"> |
|||
<extToolkit:WatermarkTextBox.WatermarkTemplate> |
|||
<DataTemplate> |
|||
<Border BorderBrush="Green" BorderThickness="1" Padding="5" > |
|||
<ContentControl Content="{Binding}" Foreground="DarkRed" FontWeight="Bold" Focusable="False" /> |
|||
</Border> |
|||
</DataTemplate> |
|||
</extToolkit:WatermarkTextBox.WatermarkTemplate> |
|||
</extToolkit:WatermarkTextBox> |
|||
</StackPanel> |
|||
</Grid> |
|||
</infControls:DemoView> |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using Samples.Infrastructure.Controls; |
|||
using Microsoft.Practices.Prism.Regions; |
|||
|
|||
namespace Samples.Modules.Text.Views |
|||
{ |
|||
/// <summary>
|
|||
/// Interaction logic for WatermarkTextBoxView.xaml
|
|||
/// </summary>
|
|||
[RegionMemberLifetime(KeepAlive=false)] |
|||
public partial class WatermarkTextBoxView : DemoView |
|||
{ |
|||
public WatermarkTextBoxView() |
|||
{ |
|||
InitializeComponent(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
|||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> |
|||
|
|||
<Style x:Key="Header" TargetType="TextBlock"> |
|||
<Setter Property="FontSize" Value="18" /> |
|||
<Setter Property="FontWeight" Value="Bold" /> |
|||
<Setter Property="Foreground" Value="#FF8605BD" /> |
|||
<Setter Property="Margin" Value="0,5" /> |
|||
</Style> |
|||
|
|||
</ResourceDictionary> |
|||
Loading…
Reference in new issue