当前位置: 首页 > 软件库 > 手机/移动开发 > >

MvvmCross-Dreams

授权协议 Apache-2.0 License
开发语言 Java
所属分类 手机/移动开发
软件类型 开源软件
地区 不详
投 递 者 闾丘山
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Xamarin MvvmCross DREAMS

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 �� Check out mvvmcross.com to get started with MvvmCross �� MvvmCross is a cross-platform MVVM framework. It enables developers to create apps using the MVVM pattern on Xamarin.iOS, Xamarin.

  • MvxPlugins Plugin NuGet version Fetcher Logger Dialog Fetcher The fetcher plugin is a small wrapper around https://github.com/mgj/fetcher that allows you to inject the IFetcherService interface in you

  • 我正在尝试在MVVMCross Xamarin Adroid应用程序中使用ActionBar。我能够在片段中加载布局,问题是上下文总是指向MainView而不是布局视图。我试图更改上下文,但资源异常。错误是 Java.Lang.NullPointerException:尝试在 null 对象引用上调用虚拟方法 'android.content.res.Resources android.conte

  • 无法安装包“MVVMCROSS.PortableSupport 3.2.2”。您正试图将此包安装到目标为“Xamarin.ios,version=v1.0”的项目中,但该包不包含与该框架兼容的任何程序集引用或内容文件。有关详细信息,请与包作者联系。 请帮忙。

  • 我们正在开发一个应用程序,当应用程序不活动时,它会收到吐司通知。但是看起来Mvvmcross核心已经控制了应用程序和rootframe。因此,当一个toast通知开始时,用户点击了那个toast并且应用程序没有完全启动到push中设置的uri,而是启动到应用程序启动时在Core中设置的页面。 我想问一下这个案子有什么解决办法吗?非常感谢:)

  • 我正在使用MVVMCROSS6与Xamarin Android。刚刚升级到MVX6.2,但问题仍然存在。我正在跟随样例游乐场加载视页。我有一个活动持有3个选项卡的视图页。在活动的viewmodel中,将选项卡添加到ViewPager中: 在playground示例中,当通过导航到那些选项卡的viewmodel构建viewpager时,不会创建选项卡片段。片段只有在显示时才会被创建。 对于我的第二和