<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
    <CodeSnippet Format="1.0.0">
        <Header>
            <Title>Definir una propiedad DependencyProperty asociada</Title>
            <Shortcut>propa</Shortcut>
            <Description>Fragmento de código para una propiedad adjunta que utiliza DependencyProperty como memoria auxiliar</Description>
            <Author>Microsoft Corporation</Author>
            <SnippetTypes>
                <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
        </Header>
        <Snippet>
            <Declarations>
                <Literal>
                    <ID>type</ID>
                    <ToolTip>Tipo de propiedad</ToolTip>
                    <Default>int</Default>
                </Literal>
                <Literal>
                    <ID>property</ID>
                    <ToolTip>Nombre de la propiedad</ToolTip>
                    <Default>MyProperty</Default>
                </Literal>
                <Literal>
                    <ID>ownerclass</ID>
                    <ToolTip>Clase propietaria de esta propiedad.  Normalmente, es la clase en la que se declara.</ToolTip>
                    <Default>ownerclass</Default>
                </Literal>
                <Literal>
                    <ID>defaultvalue</ID>
                    <ToolTip>Valor predeterminado de esta propiedad.</ToolTip>
                    <Default>0</Default>
                </Literal>
            </Declarations>
            <Code Language="csharp">
                <![CDATA[
                
public static $type$ Get$property$(DependencyObject obj)
{
    return ($type$)obj.GetValue($property$Property);
}

public static void Set$property$(DependencyObject obj, $type$ value)
{
    obj.SetValue($property$Property, value);
}

// Using a DependencyProperty as the backing store for $property$.  This enables animation, styling, binding, etc...
public static readonly DependencyProperty $property$Property =
    DependencyProperty.RegisterAttached("$property$", typeof($type$), typeof($ownerclass$), new PropertyMetadata($defaultvalue$));

$end$]]>
            </Code>
        </Snippet>
    </CodeSnippet>
</CodeSnippets>
