This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Threading.Tasks; | |
using MvvmCross.Plugins.Sqlite; | |
namespace ****.Repositories | |
{ | |
public interface IRepository<T> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ViewModel Creation | |
In MvvmCross v3 - Hot Tuna - the default ViewModel location and construction was overhauled in order to provide 3 new features: | |
- constructor based Dependency Injection | |
- navigation using Typed navigation classes | |
- saving and reloading VM state for 'tombstoning' | |
These changes were breaking changes for existing v1 and vNext apps, but provide significant testability and usability advantages for MvvmCross developers. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Foundation; | |
using MvvmCross.Binding.BindingContext; | |
using MvvmCross.Binding.iOS.Views; | |
using UIKit; | |
namespace MonkeyList.Core.iOS | |
{ | |
public partial class MonkeyCell : MvxTableViewCell | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using MonkeyList.Core.ViewModels; | |
using MvvmCross.Binding.BindingContext; | |
using MvvmCross.Binding.iOS.Views; | |
using MvvmCross.iOS.Views; | |
using UIKit; | |
namespace MonkeyList.Core.iOS | |
{ | |
public partial class MonkeysView : MvxViewController<MonkeysViewModel> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MonkeyList.Core | |
{ | |
public class Monkey | |
{ | |
public string Name { get; set; } | |
public string Location { get; set; } | |
public string Details { get; set; } | |
public string Image { get; set; } | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MvvmCross.Core.ViewModels; | |
namespace MonkeyList.Core.ViewModels | |
{ | |
public class MonkeysViewModel : MvxViewModel | |
{ | |
public MvxObservableCollection<Monkey> Monkeys => new MvxObservableCollection<Monkey>(); | |
public MonkeysViewModel() | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.App; | |
using Android.OS; | |
using MvvmCross.Droid.Views; | |
namespace MonkeyList.Droid | |
{ | |
[Activity] | |
public class MonkeysView : MvxActivity | |
{ | |
protected override void OnCreate(Bundle bundle) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:local="http://schemas.android.com/apk/res-auto" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" | |
android:background="@android:color/darker_gray"> | |
<MvxRecyclerView | |
android:id="@+id/my_recycler_view" | |
android:scrollbars="vertical" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
xmlns:local="http://schemas.android.com/apk/res-auto" | |
android:orientation="horizontal" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:padding="2dp"> | |
<android.support.v7.widget.CardView | |
android:layout_width="match_parent" | |
android:layout_height="match_parent" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace MonkeyList.Droid | |
{ | |
public class Setup : MvxAndroidSetup | |
{ | |
//Default stuff goes here | |
protected override IEnumerable<Assembly> AndroidViewAssemblies => new List<Assembly>(base.AndroidViewAssemblies) | |
{ | |
typeof(MvvmCross.Droid.Support.V7.RecyclerView.MvxRecyclerView).Assembly | |
}; |
OlderNewer