This file contains 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
public class QuotePage : ContentPage | |
{ | |
//automatically populated when pushed | |
public QuotePageModel PageModel { get; set; } | |
public QuotePage () | |
{ | |
} | |
//automatically executed when pushed |
This file contains 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
public class QuotePageModel : BasePageModel | |
{ | |
IDatabaseService _databaseService; | |
public Quote Quote { get; set; } | |
//The database service is automatically injected. | |
public QuotePageModel (IDatabaseService databaseService) | |
{ | |
_databaseService = databaseService; | |
} |
This file contains 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
public class RootContainerPage : MasterDetailPage, IRootNavigation | |
{ | |
ContentPage _menuPage; | |
NavigationPage _contactNavPage, _quotesNavPage; | |
public RootContainerPage () | |
{ | |
_contactNavPage = new NavigationPage (BasePageModel.ResolvePageModel<ContactsRootPageModel> (null)); | |
_quotesNavPage = new NavigationPage (BasePageModel.ResolvePageModel<QuotesRootPageModel> (null)); | |
Detail = _contactNavPage; |
This file contains 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
[TestFixture] | |
public class ContactPageModelTests | |
{ | |
[Test] | |
public static void CreateNewContact() | |
{ | |
var container = A.Fake<IRootNavigation> (); | |
TinyIoC.TinyIoCContainer.Current.Register<IRootNavigation> (container); | |
var db = new DatabaseService (new SQLiteFactory()); |
This file contains 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
public class JellyBeanGraphCalculator | |
{ | |
IDataSource _datasource; | |
public JellyBeanGraphCalculator (IDataSource datasource) | |
{ | |
_datasource = datasource; | |
} | |
public IEnumerable<JellyBeanGraphData> GetGraphData() | |
{ |
This file contains 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
public class LocalDataSource : IDataSource | |
{ | |
SQLiteConnection _sqliteConnection; | |
public LocalDataSource () | |
{ | |
_sqliteConnection = Xamarin.Forms.DependencyService.Get<ISQLiteFactory> ().GetConnection("app.db"); | |
CreateTable (); | |
} |
This file contains 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
/* | |
* Note* this is for demo purposes only and is not a example of good network code, | |
* http://www.michaelridland.com/mobile/asp-net-mvc-xamarin-mashups/ | |
*/ | |
public class RemoteDataSource : IDataSource | |
{ | |
static string HostBase = "http://192.168.56.101:49203"; | |
public RemoteDataSource () | |
{ | |
} |
This file contains 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.Threading.Tasks; | |
using System.Linq; | |
using System.Diagnostics; | |
namespace Robotics.Mobile.Core.Bluetooth.LE | |
{ | |
public static class Extensions | |
{ | |
/// <summary> |
This file contains 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
public partial class FollowFingerViewController : UIViewController | |
{ | |
static bool UserInterfaceIdiomIsPhone { | |
get { return UIDevice.CurrentDevice.UserInterfaceIdiom == UIUserInterfaceIdiom.Phone; } | |
} | |
UIView _square; | |
public FollowFingerViewController () | |
{ |
This file contains 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
public class MvxBindableView : MvxView, IMvxTouchView, IMvxEventSourceViewController | |
{ | |
public event EventHandler ViewDidLoadCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewWillAppearCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewDidAppearCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewDidDisappearCalled; | |
public event EventHandler<MvxValueEventArgs<bool>> ViewWillDisappearCalled; | |
public event EventHandler DisposeCalled; | |
OlderNewer