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 Definition.Interfaces; | |
using Mobile.ViewModel; | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Xamarin.Forms; | |
namespace Mobile.View |
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
// Pass parameter to view model | |
var model = page.BindingContext as BaseViewModel; | |
if (model != null) | |
await model.OnNavigated(parameter); |
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
<Button Command="{Binding LoginCommand}" Text="Login" /> | |
private RelayCommand _loginCommand; | |
public RelayCommand LoginCommand | |
{ | |
get | |
{ | |
return _loginCommand | |
?? (_loginCommand = new RelayCommand( | |
async () => |
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
private LoginModel _model = null; | |
public LoginModel Model | |
{ | |
get | |
{ | |
return _model; | |
} | |
set | |
{ | |
if (value != _model) |
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
public string Username | |
{ | |
get | |
{ | |
return _model.Username; | |
} | |
set | |
{ | |
_model.Username = value; |
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
var uniqueKey = System.Guid.NewGuid().ToString(); | |
var model = SimpleIoc.Default.GetInstance<LoginModel>(uniqueKey); | |
// Must remmeber to cleanup, otherwise all new instances are cached | |
SimpleIoc.Default.Unregister(uniqueKey); |
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
public partial class BindablePicker : Picker | |
{ | |
public BindablePicker() | |
{ | |
InitializeComponent(); | |
this.SelectedIndexChanged += OnSelectedIndexChanged; | |
} | |
public static BindableProperty ItemsSourceProperty = |
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
public interface ISQLite { | |
void CloseConnection(); | |
SQLiteAsyncConnection GetAsyncConnection(); | |
void DeleteDatabase(); | |
} |
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
public class SQLite_WinPhone : ISQLite | |
{ | |
private static SQLiteConnectionWithLock _conn; | |
public SQLite_WinPhone() { } | |
private static Object _connectionLock = new Object(); | |
private string DatabaseName = "DatabaseName.db3"; |
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
public class SQLite_Android : ISQLite | |
{ | |
private SQLiteConnectionWithLock _conn; | |
public SQLite_Android() | |
{ | |
} | |
OlderNewer