Created
October 12, 2012 10:05
-
-
Save nseba/3878517 to your computer and use it in GitHub Desktop.
Validation Control
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:Views="using:Byteflux.Views"> | |
<SolidColorBrush x:Key="ValidationErrorBrush" Color="Orange"/> | |
<Style x:Key="ValidationTextStyle" TargetType="TextBlock" BasedOn="{StaticResource ItemTextStyle}"> | |
<Setter Property="HorizontalAlignment" Value="Left"/> | |
<Setter Property="VerticalAlignment" Value="Top"/> | |
<Setter Property="Foreground" Value="{StaticResource ValidationErrorBrush}"/> | |
</Style> | |
<Style TargetType="Views:ValidationResultPlaceholder"> | |
<Setter Property="Margin" Value="0,10,0,10"/> | |
<Setter Property="Template"> | |
<Setter.Value> | |
<ControlTemplate TargetType="Views:ValidationResultPlaceholder"> | |
<ItemsControl ItemsSource="{TemplateBinding Content}"> | |
<ItemsControl.ItemTemplate> | |
<DataTemplate> | |
<TextBlock Text="{Binding}" Style="{StaticResource ValidationTextStyle}"/> | |
</DataTemplate> | |
</ItemsControl.ItemTemplate> | |
</ItemsControl> | |
</ControlTemplate> | |
</Setter.Value> | |
</Setter> | |
</Style> | |
</ResourceDictionary> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Byteflux.Views | |
{ | |
using Windows.UI.Xaml.Controls; | |
public sealed class ValidationResultPlaceholder : ContentControl | |
{ | |
public ValidationResultPlaceholder() | |
{ | |
DefaultStyleKey = typeof(ValidationResultPlaceholder); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment