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 Project : ObservableObject | |
{ | |
private string _title; | |
public string Title | |
{ | |
get { return _title; } | |
set | |
{ | |
_title = value; | |
RaisePropertyChanged(nameof(Title)); |
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
<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> |
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 App() | |
{ | |
InitializeComponent(); | |
MainPage = new TimerPage(); | |
} |
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
<?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> |
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 enum ToDoItemState | |
{ | |
ToDo, | |
Done | |
} | |
public class ToDoItem | |
{ | |
public string Title { get; set; } | |
public string Description { get; set; } |
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
[XamlCompilation(XamlCompilationOptions.Compile)] | |
public partial class OverviewPage : ContentPage | |
{ | |
public OverviewPage () | |
{ | |
InitializeComponent (); | |
BindingContext = new OverviewVM(); | |
} | |
} |
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 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" }); |
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 App () | |
{ | |
InitializeComponent(); | |
MainPage = new OverviewPage(); | |
} |
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 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); |
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 interface IEntity | |
{ | |
int Id { get; set; } | |
} |
OlderNewer