Skip to content

Instantly share code, notes, and snippets.

@CodingGorilla
CodingGorilla / WpfPopupError.xaml
Created January 24, 2012 21:22
Uses the Validation.ErrorTemplate to create a popup error indicator on a WPF TextBox control
<Style TargetType="{x:Type TextBox}">
<Setter Property="Validation.ErrorTemplate">
<Setter.Value>
<ControlTemplate>
<Grid>
<Border BorderBrush="#FFCB2E2E" BorderThickness="1" Background="#11FF0000" IsHitTestVisible="False" x:Name="errorBorder"/>
<AdornedElementPlaceholder x:Name="placeholder" />
<Popup AllowsTransparency="True" HorizontalAlignment="Right" HorizontalOffset="0" VerticalOffset="0" PopupAnimation="Fade" Placement="Right"
PlacementTarget="{Binding ElementName=errorBorder}" IsOpen="{Binding ElementName=placeholder, Path=AdornedElement.IsFocused, Mode=OneWay}">
<StackPanel Orientation="Horizontal">
@guitarrapc
guitarrapc / UsingNameSpace-Class.ps1
Last active February 8, 2017 21:52
PowerShell 5.0 using namespace syntax for .NET Operation
#Require -Version 5.0
# PowerShell 5.0 now supports <using namespace NameSpace> sysntax like C#!
using namespace System;
using namespace System.Text;
using namespace System.Diagnostics;
using namespace System.Linq;
using namespace System.Collections.Generic;
class NameSpaceSyntaxTest