2 Star 0 Fork 1

waleswood / Caliburn.Metro

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Unlicense

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).

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org/>

简介

A library that combines MahApps.Metro with Caliburn.Micro for Metro UI styled WPF applications. 展开 收起
C#
Unlicense
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C#
1
https://gitee.com/waleswood/Caliburn.Metro.git
git@gitee.com:waleswood/Caliburn.Metro.git
waleswood
Caliburn.Metro
Caliburn.Metro
master

搜索帮助