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
// place this in your controller | |
// View is the view the control sits in | |
// txtSelect is the name of the textbox the spinner "sits" in - as soon as you select | |
// the textbox, the UIPickerView fires up | |
// information is a List<string> | |
txtSelect.EditingDidBegin += delegate | |
{ | |
txtSelect.InputView = PickerUI.CreateDropList(View, new UIPickerView(), txtSelect, information); | |
}; |
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 T callService<T>(string method, string json, string auth, bool post = false, List<string> headers = null) where T : new() | |
{ | |
string url = string.Format("{0}/{1}", _configuration.BaseUrl, method); | |
var request = WebRequest.Create(url) as HttpWebRequest; | |
request.Method = !post ? "GET" : "POST"; | |
request.Accept = "application/json"; | |
request.ContentType = "application/json"; | |
request.Headers["Authorization"] = auth; | |
if (headers != null) | |
{ |
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
txtEmail.EditingDidBegin += delegate | |
{ | |
UIUtils.SetKeyboardEditorWithCloseButton(txtEmail, UIKeyboardType.Default); | |
UIUtils.AnimateTextField(View, true); | |
}; | |
txtEmail.EditingDidEnd += delegate | |
{ | |
UIUtils.AnimateTextField(View, false); | |
}; |
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
// from my DTO | |
public class PropertyChange : INotifyPropertyChanged | |
{ | |
public event PropertyChangedEventHandler PropertyChanged; | |
protected virtual void OnPropertyChanged(string propertyName) | |
{ | |
if (PropertyChanged == null) | |
return; |
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 static class SendData | |
{ | |
readonly static string BASEURL = "https://www.someurl.com/api"; | |
static string Url; | |
public static HttpWebRequest SetupRequest | |
{ | |
get | |
{ | |
var request = WebRequest.Create(Url) as HttpWebRequest; |
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 mynamespace | |
{ | |
using Xamarin.Forms; | |
public class TopBar : View | |
{ | |
private string Title, LeftImage, RightImage; | |
Page currentPage; | |
public TopBar(string text = "", Page current = null, string leftImage = "", string rightImage = "") |
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
// picker | |
var picker = new Picker | |
{ | |
HorizontalOptions = LayoutOptions.CenterAndExpand, | |
WidthRequest = App.ScreenSize.Width * .8 | |
}; | |
picker.Items.Add(LangResources.LangEnglish); | |
picker.Items.Add(LangResources.LangDanish); | |
picker.Items.Add(LangResources.LangDutch); |
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 List<T> GetListOfObjects<T>(string id) where T:class, IIdentity | |
{ | |
lock (dbLock) | |
{ | |
using (var sqlCon = new SQLiteConnection(App.Self.SQLitePlatform, App.Self.DBConnection)) | |
{ | |
sqlCon.Execute(DBClauseSyncOff); | |
string sql = string.Format("SELECT * FROM {0} WHERE id=?", GetName(typeof(T).ToString())); | |
var data = sqlCon.Query<T>(sql, id); | |
return data; |
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 CustomImageRenderer : ImageRenderer | |
{ | |
MyRect imgBorderRect; | |
private Rect mBounds; | |
private Paint mBorderPaint; | |
protected override void OnElementChanged(ElementChangedEventArgs<Image> e) | |
{ | |
base.OnElementChanged(e); | |
if (e.NewElement != null) |
OlderNewer