Skip to content

A library that combines MahApps.Metro with Caliburn.Micro for Metro UI styled WPF applications.

License

Notifications You must be signed in to change notification settings

norgie/Caliburn.Metro

 
 

Repository files navigation

Caliburn.Metro

Library combines MahApps.Metro and Caliburn.Micro for Metro UI styled WPF applications

It provides Caliburn.Micro Bootstrapper and MahApps.Metro MetroWindow integrated WindowManager. Also project contains Autofac Bootstrapper integration.

Default Setup Demo application

  //Basic AppBootstrapper
  public class AppBootstrapper : CaliburnMetroCompositionBootstrapper<AppViewModel>
  {

  }
    
  //AppWindowManager with custom Main window
  [Export(typeof(IWindowManager))]
  public class AppWindowManager : MetroWindowManager
  {
      public override MetroWindow CreateCustomWindow(object view, bool windowIsView)
      {
          if (windowIsView)
          {
              return view as MainWindowContainer;
          }

          return new MainWindowContainer
          {
            Content = view
          };
      }
  }

Autofac Bootstrapper Setup Demo application

//Autofac AppBootstrapper
public class AppBootstrapper : CaliburnMetroAutofacBootstrapper<AppViewModel>
{
    protected override void ConfigureContainer(ContainerBuilder builder)
    {
        builder.RegisterType<AppWindowManager>().As<IWindowManager>().SingleInstance();
        var assembly = typeof(AppViewModel).Assembly;
        builder.RegisterAssemblyTypes(assembly)
            .Where(item => item.Name.EndsWith("ViewModel") && item.IsAbstract == false)
            .AsSelf()
            .SingleInstance();
    }
}

//AppWindowManager with custom Main window
public class AppWindowManager : MetroWindowManager
{
    public override MetroWindow CreateCustomWindow(object view, bool windowIsView)
    {
        if (windowIsView)
        {
            return view as MainWindowContainer;
        }
        return new MainWindowContainer
        {
            Content = view
        };
    }
}

License

Code and documentation are available according to the Unlicense (see LICENSE).

About

A library that combines MahApps.Metro with Caliburn.Micro for Metro UI styled WPF applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 99.2%
  • Batchfile 0.8%