Project template for Caliburn.Micro WPF application using MahApps.Metro windows.
IPropertyChanged
notifications are implemented using Fody.PropertyChanged. Just use using PropertyChanged;
and add the [ImplementPropertyChanged]
attribute to your ViewModel classes.App.xaml.cs
for a sample usage using Caliburn.Micro.Logging
.generate.bat
file. It will generate the Visual Studio template using the latest sources.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 :
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.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.
App.xaml
resourcesMasterViewModel
and the AppWindowManager
through IoCAppWindowManager
instantiates either the BaseWindow
or the BaseDialogWindow
, which use MahApps.MetroMasterViewModel
is a Caliburn Conductor
, which means it only "wires" the screens together. By default, it loads the MainViewModel
.此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。