As promised, MoXAMLPowerToys is being enhanced and updated. To this end, I’ve been hard at work tidying up the code and responding to the comments raised in the original post.

The original code has been heavily rejigged to make it easier for me to add new features and in the process I’ve added a new power toy; now it’s simple to convert an automatic property to use INotifyPropertyChanged. All you need to do is pick the property in the code window and select Notify Property (C# Only), and it will add the necessary plumbing.

Cunningly enough, it adds the Changed method if it’s not already present. ;->

Notify Property in action:

After the command:


You can download the latest source (and a setup) here. (Please redownload this package, I’ve updated the setup project to move the application Addin file into the Addins directory, and to point it to the installation folder as a custom action).

Source moved here.

As always, keep your comments coming in and let me know what else you’d like to see – and while you’re at it, don’t forget to download the original XAMLPowerToys.

11 thoughts on “More MoXAML

  1. Pingback: MoXAMLPowerToys « Musings and frustrations

  2. Jeremy Robertson

    Email me your e-mail address. I added a command that I find very useful and I’d let to send it to you in case you want to add it in with your stuff.

    This is fantastic code to see. I’ve been wanting to make an add-on for some time and this was just what I needed to get myself to do it.

  3. Pingback: XAML Power Toys 3.0.0 Released - Code Name: Refactored « Karl On WPF - .Net

  4. Hey Pete, I’ve got an idea for another MoXAML timesaver: automating the creation of a DependencyProperty.

    I envision selecting from the MoXAML menu what type you want (normal, attached, attached read-only, etc.), which will prompt you for a name, eg. “HighlightBrush”, and a type (“Brush”), and default value (“Brushes.Blue”) and will generate the following line:

    public static readonly DependencyProperty HighlightBrushProperty = DependencyProperty.Register( “HighlightBrush”, typeof( Brush ), typeof( ), new PropertyMetadata( Brushes.Blue, DependencyPropertyChanged ) );

    as well as the DependencyPropertyChanged method (that doesn’t necessarily have to do anything, but gives the user a quick and hooked-up spot to add functionality).

    If you really wanted to go the extra mile you could even generate a HighlightBrushChanged event and hook it up in the static DependencyPropertyChanged method like so:

    private static void DependencyPropertyChanged( DependencyObject sender, DependencyPropertyChangedEventArgs e ) {
    ( ()sender ).OnHighlightBrushChanged( e );

    …which would also involve generating the HighlightBrushChanged event and OnHighlightBrushChanged:

    public event DependencyPropertyChanged HighlightBrushChanged;
    internal void OnHighlightBrushChanged( DependencyPropertyChangedEventArgs e ) {
    if ( HighlightBrushChanged != null )
    HighlightBrushChanged( this, e );

    … tall order I know. 🙂

  5. You’re reading my mind here Logan. That’s on my wishlist right now.

    Just wait until you see the next version – the AppWizard in it is cool. It’s taking a lot of coding, but it’s going to be worth the wait (I hope).

  6. peteohanlon

    Logan – part of what I’m trying to do with the Power Toys is reduce the amount of boilerplate code that we have to type.

    Karl’s PowerToys are a huge step in this direction because they make them so simple to generate business forms, which is about 90% of what most companies will look to do. I can’t, and shouldn’t, try to compete with that, so I’m trying to fill in the bits that surround it – the bits that I always wish there was an easier way to do.

    OK – that sounded preachy. It’s not meant to be – it’s just a quick overview of the ethos behind MoXAML. Now, if only I could come up with a cool codename for it. Karl’s got Ocean and Hawaii – I don’t really want to go with North Sea or Scilly Isles.;->

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s