Giter Site home page Giter Site logo

bxf's Introduction

Basic Xaml Framework

Dependabot Status

Basic Xaml Framework (Bxf) is a simple, streamlined set of UI components designed to demonstrate the minimum framework functionality required to make MVVM work well while leveraging the Visual Studio 2010 XAML designer ("Cider"). Bxf works with Silverlight, WPF and WP7.

Bxf was transferred from CodePlex to GitHub September 1, 2015.

The Bxf download includes the framework binaries, along with sample application code for WPF, Silverlight and Windows Phone.


In its simplest form, Bxf acts as a message or request router from application code to a presenter handler.

The idea is that your application code, typically your viewmodel code, needs to do a set of basic things:

  1. Show views
  2. Show status information
  3. Show error information

At runtime these need to be actually displayed to a user. At test time they should not be displayed, but instead the fact that they should have been displayed needs to be recorded, so the unit test can verify that the attempt was made.

To this end, Bxf has two primary interfaces: IShell and IPresenter. And it has a singleton instance of the IShell/IPresenter implementation, accessed through the Bxf.Shell.Instance static property.

Bxf.Shell.Instance exposes the IShell interface by default, so application code can easily call its ShowView, ShowStatus and ShowError methods.

But before the application invokes those methods, you need to create a presenter that actually makes those methods do something useful. The presenter casts Bxf.Shell.Instance to IPresenter and handles three events: OnShowView, OnShowStatus and OnShowError.

A runtime presenter is usually an object that is bound to the main form or main page - basically the main UI shell element - of your application. In the constructor of this presenter object, I have handlers for these three events, and in those handlers is where my code (indirectly or directly) causes the UI shell to display the view, status or error information.

Once the presenter events are being handled, all the rest of the application code can use call the three methods on Bxf.Shell.Instance to show views, status and error information.

In my unit test project I also have a presenter. This is something I typically set up in the test initialization method, again handling the three events. For testing though, I just store the view, region, error, title and status information in private fields so my unit test methods can check those fields to see if the appropriate view, status or error information would have been displayed were the application actually running.

bxf's People

Contributors

dependabot-preview[bot] avatar dependabot-support avatar rockfordlhotka 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.