Breaking Changes from 4.4.2 to 4.5.1 #154
Replies: 1 comment
-
The changelog from 4.4.2 to 4.5 can be found here which explains the breaking changes. The sample app also contains the changes. State-specific properties have been replaced with state-specific styles. This way, you can change any property instead of just the ones I specifically add (BackgroundColor, TextColor, Command, CommandParameter). Your example should now be: <xc:DayView
DateTime="{Binding DateTime}"
IsCurrentMonth="{Binding IsCurrentMonth}"
IsInvalid="{Binding IsInvalid}"
IsSelected="{Binding IsSelected}"
IsToday="{Binding IsToday}"
Style="{StaticResource DefaultDayViewStyle}">
<xc:DayView.CurrentMonthStyle>
<Style BasedOn="{x:Static Styles:DefaultStyles.DefaultDayViewCurrentMonthStyle}" TargetType="{x:Type xc:DayView}">
<Setter Property="Command" Value="{Binding BindingContext.ChangeDateSelectionCommand, Source={x:Reference This}}"/>
<Setter Property="CommandParameter" Value="{Binding DateTime}"/>
</Style>
</xc:DayView.CurrentMonthStyle>
<xc:DayView.TodayStyle>
<Style BasedOn="{x:Static Styles:DefaultStyles.DefaultDayViewTodayStyle}" TargetType="{x:Type xc:DayView}">
<Setter Property="Command" Value="{Binding BindingContext.ChangeDateSelectionCommand, Source={x:Reference This}}"/>
<Setter Property="CommandParameter" Value="{Binding DateTime}"/>
</Style>
</xc:DayView.TodayStyle>
<xc:DayView.SelectedStyle>
<Style BasedOn="{x:Static Styles:DefaultStyles.DefaultDayViewSelectedStyle}" TargetType="{x:Type xc:DayView}">
<Setter Property="Command" Value="{Binding BindingContext.ChangeDateSelectionCommand, Source={x:Reference This}}"/>
<Setter Property="CommandParameter" Value="{Binding DateTime}"/>
</Style>
</xc:DayView.SelectedStyle>
</xc:DayView> Where the It is more verbose but it allows for greater customisation and removes the need to redefine default values to try to match the default style and also allows easier customisation in C# because of the |
Beta Was this translation helpful? Give feedback.
-
Hello,
I was trying to update the nuget for Xamarin Forms, and found there were a good amount of breaking changes. Looks like a lot of the commands have been removed from "DayView". How can I update this to the latest library?
Beta Was this translation helpful? Give feedback.
All reactions