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
"commands": { | |
"web": "Microsoft.AspNet.Server.Kestrel", | |
"ef" : "EntityFramework.Commands" | |
}, |
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 NSDate DateTimeToNSDate(this DateTime date) | |
{ | |
DateTime reference = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(2001, 1, 1, 0, 0, 0) ); | |
return NSDate.FromTimeIntervalSinceReferenceDate( (date - reference).TotalSeconds); | |
} |
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 DateTime NSDateToDateTime(this NSDate date) | |
{ | |
DateTime reference = TimeZone.CurrentTimeZone.ToLocalTime( new DateTime(2001, 1, 1, 0, 0, 0) ); | |
return reference.AddSeconds(date.SecondsSinceReferenceDate); | |
} |
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 override void ReceivedLocalNotification(UIApplication application, UILocalNotification notification) | |
{ | |
new UIAlertView(notification.AlertAction, notification.AlertBody, null, "OK", null).Show(); | |
// reset our badge | |
UIApplication.SharedApplication.ApplicationIconBadgeNumber = 0; | |
notification.SoundName = UILocalNotification.DefaultSoundName; | |
} |
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
UILocalNotification notification = new UILocalNotification(); | |
notification.FireDate = NSDate.Now.AddSeconds(60); | |
notification.AlertAction = "New Notification"; | |
notification.AlertBody = "Hoorrayyy.... New Notification"; | |
UIApplication.SharedApplication.ScheduleLocalNotification(notification); |
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
Countries.SouthAfrica.GetDescription() |
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 enum Countries | |
{ | |
[EnumDescription(DisplayName= "South Africa")] | |
SouthAfrica, | |
[EnumDescription(DisplayName = "United States Of America")] | |
UnitedStatesOfAmerica | |
} |
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 HomeScreenAdapter : BaseAdapter<List<Countries>> | |
{ | |
List<Countries> items; | |
Activity context; | |
public HomeScreenAdapter(Activity context, List<Countries> items) : base() | |
{ | |
this.context = context; | |
this.items = items; | |
} | |
public override long GetItemId(int position) |
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 MainActivity : Activity | |
{ | |
CountriesViewModel viewModel; | |
List<Countries> countries = new List<Countries>(); | |
protected async override void OnCreate(Bundle bundle) | |
{ | |
viewModel = new CountriesViewModel(); | |
base.OnCreate(bundle); | |
SetContentView(Resource.Layout.Main); | |
var listView = FindViewById<ListView>(Resource.Id.CountriesListView); |
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" | |
android:orientation="vertical" | |
android:layout_width="match_parent" | |
android:layout_height="match_parent"> | |
<ListView | |
android:id="@+id/CountriesListView" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" /> | |
</LinearLayout> |