title: Customize control/ Writing Control Templates in wp7
body: <p>I have been trying to customize a webbrowser control in wp7. All I need to do is to add a border property(I think it is already available in webbrowser but I have to make it mandatory when I make it as a control) and want to add a few extra event handlers and make it as a control so that it can be used later in different projects.</p>
  
  <p>I tried reading through materials in msdn for writing control template and it all revolves around writing a few xaml code and attaching it with codebehind to make it work. What I don't understand is how do I learn xaml? or in other words where is the reference for all the tags that msdn talks about in xaml? Itseems to be huge and I am not sure how to go about it. The tutorial in msdn straight away divulges into xaml code and I am totally confused..</p>
  
  <p>So now all I am trying to do is this,</p>
  
  <blockquote>
    <ol>
    <li><p>create a control in Expression Blend (Windows Phone Control Library) that would create a class (MyCustomControl) that inherits
    from CustomControl base class.</p></li>
    <li><p>Now in xaml I am adding a webbrowser control and adding four event handlers (mouseup,down etc.,).</p></li>
    <li><p>I build this control in blend and add the corresponding dll in VS2010.</p></li>
    <li><p>And now once I try to add this control to my wp7 phone application it says "Cannot create an instance of MyCustomControl"..</p></li>
    </ol>
  </blockquote>
  
  <p>These were further links that I referenced in creating one, 
  <a href="http://www.windowsphonegeek.com/articles/Creating-a-WP7-Custom-Control-in-7-Steps" rel="nofollow">Windowsphone - Creating a custom control</a>
  <a href="http://www.windowsphonegeek.com/articles/Working-with-ControlTemplates-in-Silverlight-for-WP7" rel="nofollow">Windowsphone - Control Template.</a>
  <a href="http://www.windowsphonegeek.com/articles/7-Mistakes-Developer-make-when-implementing-Windows-Phone-Custom-Controls" rel="nofollow">UserControl vs Custom Control</a>
  <a href="http://msdn.microsoft.com/en-us/library/cc278064%28v=vs.95%29.aspx" rel="nofollow">Creating a new control by creating ControlTemplate</a></p>
  
  <p>Any further help would be great.</p>