Giter Site home page Giter Site logo

ariejones / caliburn.mahapps.metro.template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cosmo0/caliburn.mahapps.metro.template

0.0 2.0 0.0 3.37 MB

Template project for Caliburn.Micro WPF application

License: MIT License

C# 83.75% Batchfile 0.37% PowerShell 15.88%

caliburn.mahapps.metro.template's Introduction

Caliburn.Micro and MahApps.Metro project template

Project template for Caliburn.Micro WPF application using MahApps.Metro windows.

What it uses

  • Caliburn.Micro is the chosen MVVM framework, to bind your ViewModels to your Views. If you're not already using MVVM, use it.
  • MahApps.Metro provides a quick and easy way to get a nice-looking application from the start.
  • MahApps.Metro.SimpleChildWindow (referenced but not used) will help you create nice-looking modal popups.
  • IPropertyChanged notifications are implemented using Fody.PropertyChanged. Just use using PropertyChanged; and add the [ImplementPropertyChanged] attribute to your ViewModel classes.
  • NLog takes care of logging purposes; see App.xaml.cs for a sample usage using Caliburn.Micro.Logging.

How to install

  1. Run the generate.bat file. It will generate the Visual Studio template using the latest sources.
  2. Restart Visual Studio.

The template is now located in new project > Visual C#. You might need to enable Nuget package restore by right clicking on the solution file and selecting Enable NuGet Package Restore.

Alternatively, you can use Visual Studio to generate the template :

  • Open the CaliburnTemplate solution and make it so it can be built properly.
  • Export the project as a template by following the steps under File > Export template. Choose "project template" and the project CaliburnTemplate, add a name/description/symbol to it and check the Import template into Visual Studio option.

Logging

The sample logging is using the Caliburn.Micro logging facade, with the Caliburn.Micro.Logging.NLog nuget package. In the App.xaml.cs static constructor, the C.M logging is initialized by setting the LogManager GetLog delegate.

By default, when you're using the C.M logging facade to log, it logs every single C.M debug message. You might not want that. The provided nlog config file ignores the C.M messages (check the rules pointing to the nil logger). If you need the C.M debug messages, just comment out those lines.

If this configuration is not to your liking, either use another Caliburn logging nuget package, or create a new one. A sample is provided in the Caliburn.Micro.Logging folder.

How it works

  • A bootstrapper is registered in the App.xaml resources
  • This bootstrapper then loads the MasterViewModel and the AppWindowManager through IoC
  • The AppWindowManager instantiates either the BaseWindow or the BaseDialogWindow, which use MahApps.Metro
  • The MasterViewModel is a Caliburn Conductor, which means it only "wires" the screens together. By default, it loads the MainViewModel.

caliburn.mahapps.metro.template's People

Contributors

cosmo0 avatar lycidas0815 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.