February 22, 2009

Subsclass UserControl in SilverLight

Filed under: Uncategorized — alexezh @ 9:30 pm

By default Expression creates custom controls derived from UserControls

partial class MyControl : UserControl

In order to derive from a different class you will have to change code in several places

Define new base class with required virtual methods. Do not make class abstract

public class MyUserControl : UserControl
public virtual void Foo() {;}

Change MyControl to use MyUserControl

partial class MyControl : UserControl
public override void Foo() {;}

Change XAML for MyControl to use

&ltMyUserControl x:Class=”MyControl”&gt

To make Blend happy, add following lines to AssemblyInfo.cs

// Make blend happy
using System.Windows.Markup;
[assembly: XmlnsDefinition(“http://schemas.microsoft.com/client/2007”, “YourNamespace”)]


February 15, 2009

Better version of VS windows hiding tool

Filed under: Uncategorized — alexezh @ 4:59 pm

Remembers which windows were shown the last time. Source is available at http://alexezh.googlepages.com/MyMacros.txt

Blog at WordPress.com.