Skip to content

Commit

Permalink
fix event view
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioSeric committed Oct 3, 2021
1 parent fc1ddbe commit 48a59fe
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public class AdvancedPageViewModel : BasePageViewModel

public AdvancedPageViewModel() : base()
{
Device.BeginInvokeOnMainThread(async () => await App.Current.MainPage.DisplayAlert("Info", "Loading events with delay, and changeing current view.", "Ok"));

Culture = CultureInfo.CreateSpecificCulture("en-GB");
// testing all kinds of adding events
// when initializing collection
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,15 @@ public RangeSelectionPageViewModel() : base()
[DateTime.Now.AddDays(-10)] = new List<AdvancedEventModel>(GenerateEvents(10, "Cool", DateTime.Now.AddDays(-10))),
[DateTime.Now.AddDays(1)] = new List<AdvancedEventModel>(GenerateEvents(2, "Boring", DateTime.Now.AddDays(1))),
[DateTime.Now.AddDays(4)] = new List<AdvancedEventModel>(GenerateEvents(10, "Cool", DateTime.Now.AddDays(4))),
[DateTime.Now.AddDays(8)] = new List<AdvancedEventModel>(GenerateEvents(10, "Cool", DateTime.Now.AddDays(8))),
[DateTime.Now.AddDays(8)] = new List<AdvancedEventModel>(GenerateEvents(1, "Cool", DateTime.Now.AddDays(8))),
[DateTime.Now.AddDays(9)] = new List<AdvancedEventModel>(GenerateEvents(10, "Cool H", DateTime.Now.AddDays(9))),
[DateTime.Now.AddDays(10)] = new List<AdvancedEventModel>(GenerateEvents(10, "Cool X", DateTime.Now.AddDays(10))),
[DateTime.Now.AddDays(16)] = new List<AdvancedEventModel>(GenerateEvents(10, "Cool B", DateTime.Now.AddDays(16))),
[DateTime.Now.AddDays(20)] = new List<AdvancedEventModel>(GenerateEvents(10, "Cool A", DateTime.Now.AddDays(20))),
[DateTime.Now.AddDays(10)] = new List<AdvancedEventModel>(GenerateEvents(100, "Cool X", DateTime.Now.AddDays(10))),
[DateTime.Now.AddDays(16)] = new List<AdvancedEventModel>(GenerateEvents(7, "Cool B", DateTime.Now.AddDays(16))),
[DateTime.Now.AddDays(20)] = new List<AdvancedEventModel>(GenerateEvents(9, "Cool A", DateTime.Now.AddDays(20))),
[DateTime.Now.AddDays(35)] = new List<AdvancedEventModel>(GenerateEvents(1, "Cool S", DateTime.Now.AddDays(35))),
[DateTime.Now.AddDays(43)] = new List<AdvancedEventModel>(GenerateEvents(4, "Cool Q", DateTime.Now.AddDays(43))),
[DateTime.Now.AddDays(46)] = new List<AdvancedEventModel>(GenerateEvents(12, "Cool ZZ", DateTime.Now.AddDays(46))),
[DateTime.Now.AddDays(51)] = new List<AdvancedEventModel>(GenerateEvents(3, "Cool Y", DateTime.Now.AddDays(51))),
};

ShownDate = ShownDate.AddMonths(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Input;
using Xamarin.Essentials;
using Xamarin.Forms;
using Xamarin.Plugin.Calendar.Models;

Expand All @@ -22,11 +23,16 @@ public class SimplePageViewModel : BasePageViewModel

public SimplePageViewModel() : base()
{
Device.BeginInvokeOnMainThread(async () => await App.Current.MainPage.DisplayAlert("Info", "Loading events with delay, and changeing current view.", "Ok"));

// testing all kinds of adding events
// when initializing collection
Events = new EventCollection
{
[DateTime.Now.AddDays(-3)] = new List<EventModel>(GenerateEvents(10, "Cool")),
[DateTime.Now.AddDays(4)] = new List<EventModel>(GenerateEvents(2, "Simple2")),
[DateTime.Now.AddDays(2)] = new List<EventModel>(GenerateEvents(1, "Simple1")),
[DateTime.Now.AddDays(1)] = new List<EventModel>(GenerateEvents(3, "Simple3")),
};

// with add method
Expand Down
1 change: 1 addition & 0 deletions src/Calendar.Plugin/Shared/Controls/GenericRepeaterView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public DataTemplate EmptyTemplate
internal GenericRepeaterView()
{
Spacing = 0;
VerticalOptions = LayoutOptions.StartAndExpand;
}

#region PropertyChanged
Expand Down

0 comments on commit 48a59fe

Please sign in to comment.