• protected override void OnNavigatedTo(NavigationEventArgs e)
    
    GraphicsDevice device = SharedGraphicsDeviceManager.Current.GraphicsDevice;
    device.SetSharingMode(true);
    
    spriteBatch = new SpriteBatch(device);
    /// Silverlight
    elementRenderer = new UIElementRenderer(this, device.Viewport.Width, device.Viewport.Height);
    
    private void OnDraw(object sender, GameTimerEventArgs e)
    // Draw Silverlight UI element to Texture
    elementRenderer.Render();
    SharedGraphicsDeviceManager.Current.GraphicsDevice.Clear(Microsoft.Xna.Framework.Color.CornflowerBlue);
    
    // Draw Silverlight UI element
    spriteBatch.Begin();
    spriteBatch.Draw(elementRenderer.Texture, Vector2.Zero, Color.White);
    spriteBatch.End();






Target Name="AfterCompile" Condition="'$(Obfuscate)'=='true'">

   <CreateProperty Value="C:\Program Files (x86)\Microsoft Visual Studio 10.0\PreEmptive Solutions\Dotfuscator Community Edition\dotfuscator.exe">
     <Output TaskParameter="Value" PropertyName="_DotfuscatorExePath" />
   </CreateProperty>
   <CreateProperty Value="$(ProjectDir)$(IntermediateOutputPath)$(TargetFileName)">
     <Output TaskParameter="Value" PropertyName="_ObfuscatedFilePath" />
   </CreateProperty>
   <CreateProperty Value="$(ProjectDir)Dotfuscated">
     <Output TaskParameter="Value" PropertyName="_DotfuscatedFolderPath" />
   </CreateProperty>
   <Exec Command="&quot;$(_DotfuscatorExePath)&quot; /in:&quot;$(_ObfuscatedFilePath)&quot; /out:&quot;$(_DotfuscatedFolderPath)&quot; /q" />
   <Copy SourceFiles="$(_DotfuscatedFolderPath)\$(TargetFileName)"
         DestinationFiles="$(_ObfuscatedFilePath)" />
 </Target>


<Optimize>true</Optimize>



    • <?xml version="1.0" encoding="utf-8"?>
      <CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2008/CodeSnippet">
        <CodeSnippet Format="1.0.0">
          <Header>
            <Title>Dependency Property for Windows Phone</Title>
            <Shortcut>propwp2</Shortcut>
      
            <Author>shinobu takahashi / CryEarth tomoyuki sasaki</Author>
            <SnippetTypes>
              <SnippetType>Expansion</SnippetType>
            </SnippetTypes>
          </Header>
          <Snippet>
            <Declarations>
              <Literal>
                <ID>type</ID>
      
                <Default>int</Default>
              </Literal>
              <Literal>
                <ID>name</ID>
      
                <Default>MyProperty</Default>
              </Literal>
              <Literal>
                <ID>ownerclass</ID>
      
                <Default>ownerclass</Default>
              </Literal>
            </Declarations>
            <Code Language="CSharp">
      
      	 public $type$ $name$
              {
                  get { return ($type$)GetValue($name$Property); }
                  set { SetValue($name$Property, value); }
              }
      
              public static readonly DependencyProperty $name$Property =
                  DependencyProperty.Register(
      				"$name$",
      				typeof($type$),
      				typeof($ownerclass$),
      
      
      					new PropertyChangedCallback(On$name$Changed)) );
      
      	private static void On$name$Changed(DependencyObject obj, DependencyPropertyChangedEventArgs e)
              {
                  $ownerclass$ userControl = obj as $ownerclass$;
      
                  if (userControl != null)
                  {
                      $type$ newValue = ($type$)e.NewValue;
                  }
              }
      
      $end$]]>
            </Code>
          </Snippet>
        </CodeSnippet>
      </CodeSnippets>