|
1 | | -# TwoWeekControl / ModernXamarinCalendar |
| 1 | +# TwoWeekControl / ModernXamarinCalendar |
| 2 | + |
2 | 3 | A Nuget Package for Xamarin Forms. Interactive Xamarin Forms Calendar |
3 | | -<a href="https://www.nuget.org/packages/ModernXamarinCalendar/">https://www.nuget.org/packages/ModernXamarinCalendar/</a> |
| 4 | +[https://www.nuget.org/packages/ModernXamarinCalendar/](https://www.nuget.org/packages/ModernXamarinCalendar/) |
4 | 5 |
|
5 | | -<img src="https://github.com/mattmorgan6/TwoWeekControl/blob/master/Images/ModernControlSnip.JPG"> |
| 6 | + |
6 | 7 |
|
7 | 8 | ## Documentation |
8 | 9 |
|
9 | 10 | ### Set Up |
| 11 | + |
10 | 12 | #### Step 1 |
11 | | - Install the Nuget Package using Nuget Package Manager or in the Package Manager Console run command: |
12 | | -> |
13 | | - Install-Package ModernXamarinCalendar -Version 1.0.0 |
14 | 13 |
|
| 14 | +Install the Nuget Package using Nuget Package Manager or in the Package Manager |
| 15 | +Console run command: |
| 16 | + |
| 17 | +``` powershell |
| 18 | +Install-Package ModernXamarinCalendar -Version 1.0.0 |
| 19 | +``` |
15 | 20 |
|
16 | 21 | #### Step 2 |
17 | | - In the XAML content page where you would like the Calendar to go (such as MainPage.xaml), write within the Content Page Tag |
18 | | -> |
19 | | - xmlns:control="clr-namespace:ModernXamarinCalendar;assembly=ModernXamarinCalendar" |
20 | 22 |
|
| 23 | +In the XAML content page where you would like the Calendar to go (such as |
| 24 | +`MainPage.xaml`), write within the Content Page Tag |
| 25 | + |
| 26 | +``` xml |
| 27 | +xmlns:control="clr-namespace:ModernXamarinCalendar;assembly=ModernXamarinCalendar" |
| 28 | +``` |
21 | 29 |
|
22 | 30 | #### Step 3 |
23 | | - Within your layout in the same XAML Page, place |
24 | | -> |
25 | | - <control:WeekControl x:Name="CalendarWeekControl" |
26 | | - HorizontalOptions="CenterAndExpand" |
27 | | - BackgroundColor="SteelBlue"/> |
28 | | - |
| 31 | + |
| 32 | +Within your layout in the same XAML Page, place |
| 33 | + |
| 34 | +``` xml |
| 35 | +<control:WeekControl x:Name="CalendarWeekControl" |
| 36 | + HorizontalOptions="CenterAndExpand" |
| 37 | + BackgroundColor="SteelBlue" /> |
| 38 | +``` |
| 39 | + |
29 | 40 | #### Step 4 |
30 | | - In the c# code for your content page (such as MainPage.xaml.cs) |
31 | | -> |
32 | | - public void DateSelectedChanged(object sender, EventArgs e) |
33 | | - { |
34 | | - WeekControl calendar = sender as WeekControl; |
35 | | - |
36 | | - // insert code here that you want to use the date selected for... |
37 | | - |
38 | | - // control.DateSelected returns a DateTime for the selected day. |
39 | | - |
40 | | - Debug.WriteLine(calendar.DateSelected.ToString()); |
41 | | - } |
42 | | - |
43 | | - |
| 41 | + |
| 42 | +In the C# code for your content page (such as `MainPage.xaml.cs`) |
| 43 | + |
| 44 | +``` csharp |
| 45 | +public void DateSelectedChanged(object sender, EventArgs e) |
| 46 | +{ |
| 47 | + WeekControl calendar = sender as WeekControl; |
| 48 | + |
| 49 | + // Insert code here that you want to use the date selected for... |
| 50 | +
|
| 51 | + // control.DateSelected returns a DateTime for the selected day. |
| 52 | +
|
| 53 | + Debug.WriteLine(calendar.DateSelected.ToString()); |
| 54 | +} |
| 55 | +``` |
| 56 | + |
44 | 57 | #### Step 5 |
45 | | - In the same c# file, write within the constructor |
46 | | - > CalendarWeekControl.DataSelectedChanged += DateSelectedChanged; |
| 58 | + |
| 59 | +In the same c# file, write within the constructor |
| 60 | + |
| 61 | +``` csharp |
| 62 | +CalendarWeekControl.DataSelectedChanged += DateSelectedChanged; |
| 63 | +``` |
47 | 64 |
|
48 | 65 | #### Step 6 |
49 | | - Insert Images |
50 | | - |
| 66 | + |
| 67 | +Insert Images |
0 commit comments