Skip to content

Instantly share code, notes, and snippets.

View FraukeN's full-sized avatar
😺
Footloose and fancy free

Frauke Nonnenmacher FraukeN

😺
Footloose and fancy free
View GitHub Profile
@FraukeN
FraukeN / Project.cs
Last active October 10, 2016 10:11
Project class
public class Project : ObservableObject
{
private string _title;
public string Title
{
get { return _title; }
set
{
_title = value;
RaisePropertyChanged(nameof(Title));
@FraukeN
FraukeN / TimerPage1
Created June 3, 2017 10:07
Timer Page Initial Layout
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="ProjectTimer.Views.TimerPage">
<StackLayout>
<Picker ItemsSource="{Binding ProjectNames}"/>
<Label Text="{Binding Duration}"
HorizontalOptions="Center"
FontSize="48"/>
<Button Text="{Binding ButtonText}" Command="{Binding TimerCommand}"/>
</StackLayout>
@FraukeN
FraukeN / App1
Created June 3, 2017 21:55
First App constructor
public App()
{
InitializeComponent();
MainPage = new TimerPage();
}
@FraukeN
FraukeN / OverviewPage.xaml
Last active February 4, 2018 16:31
OverviewPage1
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://xamarin.com/schemas/2014/forms"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="GoalBuddy.Views.OverviewPage">
<ListView ItemsSource="{Binding ToDoItems}">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Title}"/>
</DataTemplate>
</ListView.ItemTemplate>
@FraukeN
FraukeN / ToDoItem.cs
Last active February 7, 2018 21:23
ToDoItem1
public enum ToDoItemState
{
ToDo,
Done
}
public class ToDoItem
{
public string Title { get; set; }
public string Description { get; set; }
@FraukeN
FraukeN / OverviewPage.xaml.cs
Last active February 7, 2018 21:31
OverviewPage.xaml.cs 1
[XamlCompilation(XamlCompilationOptions.Compile)]
public partial class OverviewPage : ContentPage
{
public OverviewPage ()
{
InitializeComponent ();
BindingContext = new OverviewVM();
}
}
@FraukeN
FraukeN / OverviewVM.cs
Created February 7, 2018 21:35
OverviewVM 1
public class OverviewVM
{
public List<ToDoItem> ToDoItems { get; set; }
public OverviewVM()
{
ToDoItems = new List<ToDoItem>();
ToDoItems.Add(new ToDoItem { Title = "Buy cat food", Description = "It's either that or be ambushed and gnawed" });
ToDoItems.Add(new ToDoItem { Title = "Starch underwear", Description = "It ain't safe if it don't chafe" });
ToDoItems.Add(new ToDoItem { Title = "Start retro girl band", Description = "Frauke and the courgettes" });
@FraukeN
FraukeN / App.xaml.cs
Last active February 7, 2018 21:42
App 1
public App ()
{
InitializeComponent();
MainPage = new OverviewPage();
}
@FraukeN
FraukeN / IRepository.cs
Created February 14, 2018 20:01
IRepository
public interface IRepository<T>
where T : class, IEntity, new()
{
Task<T> GetAsync(int Id);
Task<IEnumerable<T>> GetAsync();
Task<IEnumerable<T>> GetAsync(Expression<Func<T, bool>> predicate);
Task<IEnumerable<T>> GetAsync(int skip, int take);
Task<IEnumerable<T>> GetAsync(Expression<Func<T, bool>> predicate, int skip, int take);
Task<T> FindAsync(Expression<Func<T, bool>> predicate);
Task<int> AddAsync(T entity);
@FraukeN
FraukeN / IEntity.cs
Created February 14, 2018 22:17
IEntity
public interface IEntity
{
int Id { get; set; }
}