-
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add default implementation of events to calendar (#183)
- Loading branch information
Showing
55 changed files
with
1,250 additions
and
434 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using XCalendar.Core.Collections; | ||
|
||
namespace XCalendar.Core.Interfaces | ||
{ | ||
public interface ICalendarDay : INotifyPropertyChanged | ||
public interface ICalendarDay : ICalendarDay<IEvent> | ||
{ | ||
} | ||
public interface ICalendarDay<TEvent> : INotifyPropertyChanged where TEvent : IEvent | ||
{ | ||
DateTime DateTime { get; set; } | ||
bool IsSelected { get; set; } | ||
bool IsCurrentMonth { get; set; } | ||
bool IsToday { get; set; } | ||
bool IsInvalid { get; set; } | ||
ObservableRangeCollection<TEvent> Events { 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
|
||
namespace XCalendar.Core.Interfaces | ||
{ | ||
public interface IEvent | ||
{ | ||
string Title { get; set; } | ||
string Description { get; set; } | ||
DateTime StartDate { get; set; } | ||
DateTime? EndDate { 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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
using System; | ||
using System.ComponentModel; | ||
using System.Runtime.CompilerServices; | ||
using XCalendar.Core.Interfaces; | ||
|
||
namespace XCalendar.Core.Models | ||
{ | ||
public class Event : IEvent, INotifyPropertyChanged | ||
{ | ||
#region Fields | ||
private string _title; | ||
private string _description; | ||
private DateTime _startDate = DateTime.Today; | ||
private DateTime? _endDate = DateTime.Today; | ||
#endregion | ||
|
||
#region Properties | ||
public string Title | ||
{ | ||
get | ||
{ | ||
return _title; | ||
} | ||
set | ||
{ | ||
if (_title != value) | ||
{ | ||
_title = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
public string Description | ||
{ | ||
get | ||
{ | ||
return _description; | ||
} | ||
set | ||
{ | ||
if (_description != value) | ||
{ | ||
_description = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
public DateTime StartDate | ||
{ | ||
get | ||
{ | ||
return _startDate; | ||
} | ||
set | ||
{ | ||
if (_startDate != value) | ||
{ | ||
_startDate = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
public DateTime? EndDate | ||
{ | ||
get | ||
{ | ||
return _endDate; | ||
} | ||
set | ||
{ | ||
if (_endDate != value) | ||
{ | ||
_endDate = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
#endregion | ||
|
||
#region Events | ||
public event PropertyChangedEventHandler PropertyChanged; | ||
#endregion | ||
|
||
#region Methods | ||
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) | ||
{ | ||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); | ||
} | ||
#endregion | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
using Xamarin.Forms; | ||
using XCalendar.Core.Models; | ||
|
||
namespace XCalendar.Forms.Models | ||
{ | ||
public class ColoredEvent : Event | ||
{ | ||
#region Fields | ||
private Color _color; | ||
#endregion | ||
|
||
#region Properties | ||
public Color Color | ||
{ | ||
get | ||
{ | ||
return _color; | ||
} | ||
set | ||
{ | ||
if (_color != value) | ||
{ | ||
_color = value; | ||
OnPropertyChanged(); | ||
} | ||
} | ||
} | ||
#endregion | ||
} | ||
} |
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
Oops, something went wrong.