<?xml version="1.0" encoding="utf-8"?> 

<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet"> 
  <CodeSnippet Format="1.0.0"> 
    <Header> 
      <SnippetTypes> 
        <SnippetType>Expansion</SnippetType> 
      </SnippetTypes> 
      <Title>Define a AttachedProperty for Silverlight application</Title> 
      <Shortcut>propas</Shortcut> 
      <Description> 
        Code snippet for a property using DependencyProperty.Attached as the backing store 
      </Description> 
      <Author>Tamir Khason</Author> 
    </Header> 
    <Snippet> 
      <Declarations> 
        <Literal Editable="true"> 
          <ID>type</ID> 
          <ToolTip>Property Type</ToolTip> 
          <Default>int</Default> 
          <Function> 
          </Function> 
        </Literal> 
        <Literal Editable="true"> 
          <ID>property</ID> 
          <ToolTip>Property Name</ToolTip>
          <Default>MyProperty</Default> 
          <Function> 
          </Function> 
        </Literal> 
        <Literal Editable="false"> 
          <ID>ownerclass</ID> 
          <ToolTip> 
            The owning class of this Property. Typically the class that it is declared in. 
          </ToolTip> 
          <Default>ClassNamePlaceholder</Default> 
          <Function>ClassName()</Function> 
        </Literal> 
      </Declarations> 
      <Code Language="csharp"> 
        <![CDATA[
#region $property$

/// <summary> 
/// Gets the $property$ possible Value of the $type$ object from attached dependency object.
/// </summary> 
public static $type$ Get$property$(DependencyObject obj)
{ 
    return ($type$)obj.GetValue($property$Property);
} 

/// <summary> 
/// Sets the $property$ possible Value of the $type$ object to attached dependency object.
/// </summary> 
public static void Set$property$(DependencyObject obj, $type$ value)
{ 
    obj.SetValue($property$Property, value);
} 

/// <summary> 
/// Identifies the $property$ attached property.
/// </summary> 
public static readonly DependencyProperty $property$Property = 
            DependencyProperty.RegisterAttached("$property$", typeof($type$), typeof($ownerclass$), null); 

#endregion $property$
$end$]]> 
      </Code> 
    </Snippet> 
  </CodeSnippet> 
</CodeSnippets>

