Select week range for separate month. #166
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
I'm using version 4.2.0 |
Beta Was this translation helpful? Give feedback.
-
Solution 1: Upgrade to > 4.5.xFrom 4.5.0, each state has its own style that is applied. This way, you are not limited to just the text colour, background colour, and commands. The For example: <xc:DayView
DateTime="{Binding DateTime}"
IsCurrentMonth="{Binding IsCurrentMonth}"
IsInvalid="{Binding IsInvalid}"
IsSelected="{Binding IsSelected}"
IsToday="{Binding IsToday}">
<xc:DayView.OtherMonthStyle>
<Style BasedOn="{x:Static Styles:DefaultStyles.DefaultDayViewOtherMonthStyle}" TargetType="{x:Type xc:DayView}">
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="TextColor" Value="White"/>
<Setter Property="BackgroundColor" Value="Red"/>
</Trigger>
</Style.Triggers>
</Style>
</xc:DayView.OtherMonthStyle>
</xc:DayView> Where the You may find more info in discussion #154. You'll also get many improvements and bug fixes since 4.2.0 :) Solution 2: TriggersYou may be able to use triggers to set the Solution 3: InheritanceYou could inherit from DayView and override the method responsible for determining the DayView's Here is an example of what you could do: public class CustomDayView : DayView
{
public override DayState EvaluateDayState()
{
if (IsSelected)
{
return DayState.Selected;
}
return base.EvaluateDayState();
}
} Then you can use your custom control inside a |
Beta Was this translation helpful? Give feedback.
Solution 1: Upgrade to > 4.5.x
From 4.5.0, each state has its own style that is applied. This way, you are not limited to just the text colour, background colour, and commands. The
XCalendar.Forms.Styles.DefaultStyles
orXCalendar.Maui.Styles.DefaultStyles
class can be used to maintain default functionality when changing these styles. You can then also apply triggers for a specific state's style. In this case, it would be forOtherMonthStyle
and you would apply solution #2 to it.For example: