title: Alias to static class in XAML
body: <p>For localization I have one resx file per XAML file. They lie in the same directory and namespace. The resx name corresponds to the XAML name with the word <em>Resources</em> appended.</p>
  
  <p>I access the resources like this:</p>
  
  <pre><code>&lt;TextBlock Text="{x:Static r:MainWindowResources.SomeText}"/&gt;
  </code></pre>
  
  <p>Since I find this quite lengthy (and there are even longer class names) I was wondering if there was some way I could define an alias to MainWindowResources. In C# I can do this with a using directive.</p>
  
  <p>It would be a lot easier if the generated resource file wrapper wouldn't be a class with static properties. A possible solution would be to use a wrapper instance which inherits from DynamicObject. You could pass it a type and access the type's static members through it. Then you'd add an instance of this wrapper as a resource in XAML.</p>
  
  <p>But I'd lose IntelliSense support and it probably wouldn't be great performance-wise either.</p>
  
  <p>Another solution would be to use the WPF Localization Extension but I'd also lose IntelliSense support. Plus I'm curios whether there is any other way to create an alias to a static class. :)</p>