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

bugthesystem/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.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published