Comments (8)
I want only one date to be selected at a time. As in the image attached. total of two dates are selected in the calendar control.
from xamforms.controls.calendar.
Hallo, I do not understand how you added 5 months to the Calendar Control. To me it looks more like you added 5 Calendar controls after each other and you want one Date selected in all of these controls, am I correct?
When you used 5 Calendar Controls you could use:
public class CalendarVM : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged;
private DateTime? _date;
public DateTime? Date
{
get { return _date; }
set
{
_date = value;
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Date));
}
}
}
And bind all the Calendar controls to the same BindingContext CalendarVM
.
var vm = new CalendarVM();
calendar1.SetBinding(Calendar.SelectedDateProperty, nameof(vm.Date));
calendar1.BindingContext = vm;
calendar2.SetBinding(Calendar.SelectedDateProperty, nameof(vm.Date));
calendar2.BindingContext = vm;
etc...........
or in xaml
<controls:Calendar SelectedDate="{Binding Date}" />
<controls:Calendar SelectedDate="{Binding Date}" />
<controls:Calendar SelectedDate="{Binding Date}" />
Then the selected date in all controls will be the same.
Hoop this helps ;)
from xamforms.controls.calendar.
Thankyou for the fast response.
To answer your question: I have added 5 different calendar controls one after each other to display more than one month at a time and Is there any other way I can add more than one month and scroll through the months using vertical scroll, same as the built in calendar control for iOS?
I hope I am missing something here.
If I am using the 5 different calendar controls for displaying 5 different months, then is there any way that, If I select a date in February then the date should be highlighted with some color, then the previously selected month in january to be unselected and color should be as normal date?
from xamforms.controls.calendar.
Hi RebeccaXam,
Thankyou for the fast response and a great control.
If I am using the 5 different calendar controls for displaying 5 different months, then my issue is now resolved using the solution provided by you.
So we can close this question. I have one related question with my implementation. If you are okay please answer it here, or else I will create it as a separate question.
Is there any other way by using only one calendar control, I can add more than one month and scroll through the months using vertical scroll, same as the built in calendar control for iOS devices?
from xamforms.controls.calendar.
I have interest in this too. I tried to attach gestures to the calendar but no success.
from xamforms.controls.calendar.
To show multiple months to scroll through use ShowNumOfMonths
= (1-12) in version 1.0.8
I added this as a feature in 1.0.8, please reopen this issue, if it is not fully fulfilled or open a new issue.
from xamforms.controls.calendar.
Thank you rebacca for the solution. When I am using 5 different calendar controls to display more than once calendar month, I have implemented your suggestion using the calendar view model to select only one date at a time in all the calendar controls. I am facing one new issue in android devices. Sometimes Date Clicked event is hitting twice on selecting a particular date other than the current month. Example: if current date selected in calendar is Jan 15th 2017, on selecting a date Feb 3rd 2017, Date clicked event is triggered twice(Event is triggering 2 times).
from xamforms.controls.calendar.
Hi,
I want to display one month dates at a time. Kindly help.
Eg: Currently it is showing Jan 1 to 31 and Feb 1 to to 11. I want to display only Jan 1 to 31 at a time.
from xamforms.controls.calendar.
Related Issues (20)
- Disable SelectedDate in Calendar after reusing the control HOT 2
- Null Reference Exception on ElementPropertyChanged HOT 6
- Xamarin Forms iOS a imagem das datas especiais não aparecem HOT 1
- Repository moved - help needed ❗️
- Importing firebase data into the Special Date parameter
- WhenChanging Month App Crashing
- WhenChanging Month App Crashing
- WhenChanging Month App Crashing
- WhenChanging Month App Crashing HOT 6
- Disabled HOT 1
- Additional properties for Calendar selection HOT 1
- BackgroundPattern doesn't work on UWP HOT 2
- iOS App crashes after update HOT 6
- iOS AutomationID
- Xamarin.forms.calendar
- Writing UI test cases for date selection in Xamforms.Calendar
- How refresh Calendar (Just Special Dates) HOT 3
- uppercase text HOT 3
- Special Date Text Turkish Character Problem
- iOS crash with Xamarin Forms 4.0 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xamforms.controls.calendar.