Giter Site home page Giter Site logo

mgj / mvvmcross-dreams Goto Github PK

View Code? Open in Web Editor NEW
30.0 3.0 1.0 486 KB

Xamarin MvvmCross DREAMS is an opinionated take on how to make an MvvmCross app.

License: Apache License 2.0

C# 88.27% HTML 7.66% CSS 4.07%
mvvmcross template template-project mvx mvvmcross-plugin xamarin android ios

mvvmcross-dreams's Introduction

Xamarin MvvmCross DREAMS

Build status

Xamarin MvvmCross DREAMS is an opinionated take on how to make an MvvmCross app. If you have any comments, concerns, critique or ideas, please create an issue (or pull request :D)

No more worrying about naming conventions, PCL profiles, android support dependencies or which logging framework to use.

Now available as Visual Studio project template!

DREAMS is now available as a project template to make it even easier for you to get up and running as fast as possible. Just follow these steps:

  1. Install the DREAMS project template from visual studio (Tools -> Extensions and Updates... -> Search for "MvvmCross DREAMS" or "artm.Dreams")
  1. Add new project - type MvvmCross DREAMS Core. OBS: Must be postfixed with ".Core" ! For example: "MyProject.Core"
  • It will spam a bunch of errors, you can safely ignore these. They are resolved by restoring nuget packages which happens automatically on build
  1. Add new project - type "MvvmCross DREAMS Droid". OBS: Must be postfixed with ".Droid" ! For example: "MyProject.Droid"
  2. Build and deploy the app!

Features

  • "Normal" full screen navigation
  • Burgermenu navigation
  • Network and background tasks
  • Logging to console/logcat and logfile
  • Threadsafe dialogs

Model-View-ViewModel (MVVM)

The solution in structured around the Model-View-ViewModel (MVVM) pattern. For those unfamiliar with this pattern it basically boils down to this:

  • Model: Data models, database etc.
  • View: UI. On android this often includes xml layout files, and on iOS xib files.
  • ViewModel: A "synthesized" version of the view, in which all the underlying data which must be presented by the view is made readily available in a way that is easily digestible by the view.

In addition to the 3 main layers, there is a collection of classes we should mention as well:

  • Services: In order to keep our ViewModels small, much business logic is made available through services. Ideally, ViewModels should only contain properties that the View can bind to - all heavy lifting and business logic should be handled by a service. In practice, however, there are often exceptions to this rule, and making services for everything business logic related is overkill.

Whats in this thing?

The folder structure aims to have folders separated by their feature rather than their type.

The solution is released with 5 screens:


  • FirstView: Shows simple text binding between input fields and textviews. Shows navigation and passing of data to other viewmodels

  • SecondView: Shows async initialization (fetching data from network to show in view). The fetched data response is cached in a Realm.io database.

  • ThirdView: Shows how to use lists. On android, the example shows how to get the Material Design feeling by collapsing the toolbar (previously known as the actionbar) when the user scrolls the list.

  • FourthView: Shows how to make a burger menu

  • FifthView: Shows how to use dialogs in a threadsafe manner

The solution uses NLog to log to the console and to disk (a logfile).

Thanks to

License

Apache 2.0

mvvmcross-dreams's People

Contributors

mgj avatar nikobearrr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

mikescandy

mvvmcross-dreams's Issues

Documentation on how to use Polly in this solution

Hello,

Thanks for your work. I just tested the templates and all is working.

I try to find a good base solution to handle exception.
Actually in get of the property Hello of the first view I add an exception.
This exception doesn't cause crash of the application and that's what I want but it doesn't show to the user that something wrong has happened.

Can you give more informations/documentation on configure polly and Nlog in this template ?

Enhancement:

  • preparing to use HockeyApp
  • IOS project

UWP project

Implement UWP clone of the android project

iOS project

Implement iOS clone of the android project

Test project template

For some reason i could not get the Dreams.Core.Tests project to work as a template, even though Dreams.Core and and Dreams.Droid both work as a template

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.