Archive

Archives pour 02/2024

Calendar with week number

The current calendar not allow to show week number, i have made somes update for show it like this (datepicker too)

you must create an attached property

and made corrections in style

and usage like this (with the new style you can disable show week number)

WARNING : for DatePicker is necessary to change style of CalendarItem for connect to dynamicresource of restyled style
CalendarStyle= »{DynamicResource {x:Type Calendar}} » or using redefine style of DatePicker 

UPDATE : for getting first day of a week when clicking on week number

if CalendarHelper.ClickWeekCommand is define you receive first day of week in command

like this

and using whith this command

Categories: Non classé Tags:

Connect FrameworkElement to MVVM

Somethimes it necessary in MVVM to knowing FrameworkElement for setting something

I have create an helper for getting this FrameworkElement in MVVM

and used in mvvm like this

and in xaml

and for sample to create an picture set in clipboard

 

Categories: Non classé Tags: