basyura / Eleve

Livet Based OreOre Framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Eleve

Livet Based OreOre Framework

(参考にして自分でアプリケーションが作りやすそうなフレームワークを作ってみましたの意)

Description

MVVM is so great. But so difficult and complex to build application.
Eleve is WPF Framwork not fussy about MVVM.

Livet

Livet is a very powerful MVVM Infrastructure for WPF

Install

ProjectTemplate

Files

EleveSample
├── Actions
│   ├── EleveSample
│   │   ├── EleveSampleActionBase.cs
│   │   ├── Initialize.cs
│   │   └── OpenItemSelector.cs
│   └── ItemSelector
│       ├── Initialize.cs
│       ├── ItemSelectorActionBase.cs
│       └── Notify.cs
├── Models
│   └── Person.cs
├── ViewModels
│   ├── EleveSampleViewModel.cs
│   └── ItemSelectorViewModel.cs
└── Views
    ├── EleveSampleView.xaml
    ├── EleveSampleView.xaml.cs
    ├── ItemSelectorView.xaml
    └── ItemSelectorView.xaml.cs

Call Action

Determined by ViewModel's name, namespace and Action name.

<Button Content="Open">
  <i:Interaction.Triggers>
    <i:EventTrigger EventName="Click">
      <ev:Execute Action="OpenItemSelector" />
    </i:EventTrigger>
  </i:Interaction.Triggers>
</Button>

Open Window

Open ItemSelectorView with param and callback.

OpenDialogWindow<ItemSelectorView>(param, (type, ret) => {
  ViewModel.Message = type.ToString() + " - " + ret;
});
 

Open ItemSelectorView with param and await.

WindowCloseResult ret = await OpenDialogWindowAsync<ItemSelectorView>(param);
ViewModel.Message = ret.Type.ToString() + " - " + ret.Result;

Close ItemSlectorView and notify param.

CloseWindow(WindowCloseType.OK, ViewModel.ID);

ThreadMode

Default mode is Foreground (in UI Thread). You can change to Background by class attribute.

[ThreadMode(ThreadMode.Background)]
public class Initialize : EleveSampleActionBase
{

If you want to change default mode from Foreground to Background in app, add setting to App.config.

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  ・・・
  <appSettings>
    <add key= "Eleve.ThreadMode" value="Background"/>
  </appSettings>
 ・・・
</configuration>

License

zlib/libpngライセンスで提供しています。zlib/libpng ライセンスでは、ライブラリとしての利用に留めるのであれば再配布時にも著作権表示などの義務はありません。しかし、ソースコードを改変しての再配布にはその旨の明示が義務付けられます。

Eleve include Livet's code.

TODO

  • Broken English
  • Is License ok?
  • Input Validation

About

Livet Based OreOre Framework

License:zlib License


Languages

Language:C# 95.3%Language:HTML 3.0%Language:CSS 1.7%