code_junkie

How to correctly inherit from a usercontrol defined in XAML in Silverlight

Nov 11th, 2011
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public class MyBase : UserControl
  2. {
  3. }
  4.  
  5. public class FirstUserControl : MyBase
  6. {
  7. ...
  8. }
  9.  
  10. <local:MyBase
  11. x:Class="FirstUserControl"
  12. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  13. xmlns:local="YourAssembly" ...>
  14.  
  15. <!-- Sticking with UserControl instead of local:MyBase makes this clearer -->
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. ..
  20. </ResourceDictionary.MergedDictionaries>
  21. </ResourceDictionary>
  22. </UserControl.Resources>
  23.  
  24. ..Your XAML
  25. </local:MyBase>
Add Comment
Please, Sign In to add comment