-
-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show weeknumbers left from calendar #186
Comments
Oo, great idea! Its not possible currently, but various template properties are available on the CalendarView if you want to implement it yourself. I'd probably use the |
@ME-MarvinE thanks for reply. Do you have examples? of |
Its on the CalendarView. Its type is a |
@ME-MarvinE thanks. |
@E75 The following code shows how to add a cyan border around the section of the CalendarView that shows the days. <xc:CalendarView>
<xc:CalendarView.DaysViewTemplate>
<ControlTemplate>
<Border
Padding="10"
Stroke="#00A0A0"
StrokeThickness="10">
<ContentPresenter/>
</Border>
</ControlTemplate>
</xc:CalendarView.DaysViewTemplate>
</xc:CalendarView> This is what the "Getting Started" repo's Maui project looks like with and without the template: |
Thanks, but are you sure I can use this? I see that your example is more about styling, while the week numbers are really part of the calendar view. In other words, if you navigate by month, the weeks must also change. The way I see it is that this is more of an extension of Do you have an example of a custom DaysViewTemplate where it is derived, where, for example, instead of 7 days, you show an extra day with an extra label or something? That would fit my scenario more. |
It was to demonstrate how to use the It would be easier if the control was based on grids, but its based on CollectionViews. So the way I'm thinking if doing it is using the But I also wanted to do it without adding any extra controls since it reduces speed, and I want the layout to be managed by one thing instead of several things trying to emulate each other's spacing and size etc. That's what I'm figuring out when thinking of how to implement this. |
It would be easier if the control was based on grids, but its based on CollectionViews. So the way I'm thinking if doing it is using the DaysViewTemplate to add a Vertical CollectionView to the left with the week numbers. That's what I expected it. Personally, I would say that there should be two extra (optional) properties on the calendar view, for example "ShowWeekNumbers" and "Weeks". Underwater it uses collectionview as far as I understand it, so instead of 7 columns, it shows 8 columns. '[Week, Mon,Tues]' <> '[Fri, Sat, Week]' Then you don't have to add extra controls for this, do you? |
Yeah I was thinking of using the DaysOfWeek CollectionView and Days CollectionView somehow but there are a few issues I need to think about:
Maybe it's not as bad as it seems, I haven't used it before, but I was thinking using a DataTemplateSelector would be the way. What is the |
@E75 Ah sorry, I didn't reply sooner, I didn't see the edit with the additional question. There is no direct property on the CalendarView to change the DayOfWeek colour. You would have to use the Seems like I forgot to dedicate a space in the wiki that explains this, I've added it to the Displaying Dates page. |
I was wondering if it was possible to show week numbers on the left?
Many users like to also see the week numbers.
The text was updated successfully, but these errors were encountered: