Extending a UserControl in Silverlight

In a current project that I’m working on, I needed to extend a UserControl to add some additional specialized functionality. This is very easy to do if all you need is to extend code, but it becomes much more difficult if you want to extend it via a XAML/C# UserControl. After much web searching, I found a very simple and elegant solution, thanks to this site. Basically, all you have to do is modify the root element of your extended file as follows:

<local:SomeBaseTypeYouWantToUse
    x:Class="MyApp.MyControl"
    xmlns:local="clr-namespace:NameSpace.To.Your.BaseClass"
/>

Where SomeBaseTypeYouWantToUse is the class that you’d like to extend. Simple!

–Adam

Update (6/3/2010):I ran into some weird problems with this hack that I was unable to resolve. If anyone ends up reading this, please let me know if this worked correctly for your application.

Setting Document Root to Point to a Network Share With Windows/Apache

Quick tip: If you’re wanting to have your Apache document root point to a network share in Windows, here’s what you have to do:

  1. Change your DocumentRoot to the network share (drive remapping doesn’t seem to work).  Example: DocumentRoot “//path/to/share”
  2. Make sure to update the DocumentRoot path in your <Directory> config
  3. Edit the Apache service
    1. On the “Log On’” tab, click the “Browse” button next to the “This account” radio button.
    2. Type in an account name that has access privileges to the network share and click “OK”
    3. Enter the correct password for the user
  4. Restart Apache and LOL your way to the bank.