question

MageshSankar-5062 avatar image
0 Votes"
MageshSankar-5062 asked ·

Need to restrict mouser hover effect on touch action


I have an custom calendar control, I have highlighted day cell on mouser over, I need to restrict the mouse hover color applied to day cell when perform touch action in calendar.Please provide any suggestions on this.

c# wpf touch

windows-wpf
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

DaisyTian-MSFT avatar image
0 Votes"
DaisyTian-MSFT answered ·

You can set CalendarDayButton's style for Calendar in the style , do not include the MouseOver state in the CommonStates under the VisualStateGroup like the below code show:

 <VisualStateGroup Name="CommonStates">
               <VisualStateGroup.Transitions>
                 <VisualTransition GeneratedDuration="0:0:0.1" />
               </VisualStateGroup.Transitions>
               <VisualState Name="Normal" />
               <VisualState Name="Pressed">
                 <Storyboard>
                   <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                    Storyboard.TargetProperty="Opacity"
                                    To="0.5"
                                    Duration="0" />
                 </Storyboard>
               </VisualState>
               <VisualState Name="Disabled">
                 <Storyboard>
                   <DoubleAnimation Storyboard.TargetName="HighlightBackground"
                                    Storyboard.TargetProperty="Opacity"
                                    To="0"
                                    Duration="0" />
                   <DoubleAnimation Storyboard.TargetName="NormalText"
                                    Storyboard.TargetProperty="Opacity"
                                    To=".35"
                                    Duration="0" />
                 </Storyboard>
               </VisualState>
             </VisualStateGroup>
· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @DaisyTian-MSFT


I need Mouse effect also when handle mouse move action . I want to restrict mouse hover only when perform touch action.

Note: I Have used Trgger to update Mouse hove color not VisualState


Thanks

0 Votes 0 ·