Coder Social home page Coder Social logo

gordias's Introduction

Welcome to Gordias WPF MVVM framework library.

Gordiasは、Livet MVVM インフラストラクチャhttp://ugaya40.net/livetを利用しつつコーディング量を減らす目的で開発されています。 リフレクションを多用しているため高速で動作させる用途には向きませんが、アプリケーションを構成する多くの部分では、高速な動作よりもコーディング量の減少とそれに伴うメンテンナンス性の向上の方が有用です。 高速動作が必要な部分では、従来のコーディング方法を併用することが可能です。

Library details

(1)CommandとPropertyをViewModelから分離  ViewModelは、View偏重のWPFでは大きくなりがちになります。Modelへの処理の分離をしたとしてもViewとの繋ぎ部分に、繰り返し同じ処理を記述しなければなりません。 Gordiasでは、下記のように、ViewModelクラスとCommand処理クラスとProperty処理クラスを分離し見通しの良いコーディングを実現します。

public class MainWindowViewModel : TacticsViewModel<MainWindowViewModelProperty, MainWindowViewModelCommand> {} public class MainWindowViewModelProperty : TacticsProperty {} public class MainWindowViewModelCommand {}

(2)Commandの実装  ボタンからのコマンドを受け取る処理を記述するには、下記のようにします。 MainWindowViewModelCommandクラスに、プロパティを一行登録し、プロパティ名と同じ名前のメソッドをMainWindowViewModelクラスへ登録するだけで、コマンドの受け取り処理は完成します。[Command]は、メソッドをコマンド用だとプログラムに判定させるための属性です。

public class MainWindowViewModel : TacticsViewModel<MainWindowViewModelProperty, MainWindowViewModelCommand> { [Command] private void TestButton() { MessageBox.Show("テスト"); } }

public class MainWindowViewModelCommand { public TacticsCommand TestButton { get; private set; } }

(2)Propertyの実装  プログラムは、MainWindowViewModelPropertyクラスへプロパティを実装するだけで、PropertyChangedEventの発生を補完します。

public class MainWindowViewModelProperty : TacticsProperty { public virtual bool IsCheck { get; set; } }

(3)ViewModel間の通信用の特殊Model

(4)グローバルデータを保持する特殊Model

以上

gordias's People

Contributors

takanemu avatar takanori-shibuya 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.