@@ -523,6 +523,68 @@ public void ItemsProperty_SetItems_TriggersOnItemsPropertyChanged()
523
523
Assert . Equal ( 2 , itemsFromProperty . Count ) ;
524
524
}
525
525
526
+ [ Fact ]
527
+ public void AccordionStyle_WhenApplied_SetsCorrectProperties ( )
528
+ {
529
+ // Arrange
530
+ var animationDuration = 100 ;
531
+ ExpanderAnimationEasing easing = new ExpanderAnimationEasing ( ) ;
532
+ easing = ExpanderAnimationEasing . SinInOut ;
533
+ ExpanderIconPosition expanderIconPosition = new ExpanderIconPosition ( ) ;
534
+ expanderIconPosition = ExpanderIconPosition . Start ;
535
+ var itemSpacing = 100 ;
536
+ AccordionExpandMode expandMode = new AccordionExpandMode ( ) ;
537
+ expandMode = AccordionExpandMode . Multiple ;
538
+ AccordionAutoScrollPosition autoScrollPosition = new AccordionAutoScrollPosition ( ) ;
539
+ autoScrollPosition = AccordionAutoScrollPosition . MakeVisible ;
540
+ var style = new Style ( typeof ( SfAccordion ) ) ;
541
+ style . Setters . Add ( new Setter
542
+ {
543
+ Property = SfAccordion . AnimationDurationProperty ,
544
+ Value = animationDuration
545
+ } ) ;
546
+ style . Setters . Add ( new Setter
547
+ {
548
+ Property = SfAccordion . HeaderIconPositionProperty ,
549
+ Value = expanderIconPosition
550
+ } ) ;
551
+ style . Setters . Add ( new Setter
552
+ {
553
+ Property = SfAccordion . AnimationEasingProperty ,
554
+ Value = easing
555
+ } ) ;
556
+ style . Setters . Add ( new Setter
557
+ {
558
+ Property = SfAccordion . ExpandModeProperty ,
559
+ Value = expandMode
560
+ } ) ;
561
+ style . Setters . Add ( new Setter
562
+ {
563
+ Property = SfAccordion . ItemSpacingProperty ,
564
+ Value = itemSpacing
565
+ } ) ;
566
+ style . Setters . Add ( new Setter
567
+ {
568
+ Property = SfAccordion . AutoScrollPositionProperty ,
569
+ Value = autoScrollPosition
570
+ } ) ;
571
+ var resources = new ResourceDictionary ( ) ;
572
+ resources . Add ( "AccordionStyle" , style ) ;
573
+ Application . Current = new Application ( ) ;
574
+ Application . Current . Resources = resources ;
575
+ var accordion = new SfAccordion ( ) ;
576
+ // Act
577
+ accordion . Style = ( Style ) Application . Current . Resources [ "AccordionStyle" ] ;
578
+ // Assert
579
+ Assert . Equal ( animationDuration , accordion . AnimationDuration ) ;
580
+ Assert . Equal ( expanderIconPosition , accordion . HeaderIconPosition ) ;
581
+ Assert . Equal ( easing , accordion . AnimationEasing ) ;
582
+ Assert . Equal ( expandMode , accordion . ExpandMode ) ;
583
+ Assert . Equal ( animationDuration , accordion . AnimationDuration ) ;
584
+ Assert . Equal ( itemSpacing , accordion . ItemSpacing ) ;
585
+ Assert . Equal ( autoScrollPosition , accordion . AutoScrollPosition ) ;
586
+ }
587
+
526
588
#endregion
527
589
528
590
#region Methods
@@ -1044,6 +1106,7 @@ public void OnHeaderIconPositionPropertyChanged_UpdatesIconPosition()
1044
1106
var accordionItem = new AccordionItem ( ) ;
1045
1107
accordion . Items . Add ( accordionItem ) ;
1046
1108
accordionItem . _accordionItemView = [ ] ;
1109
+ accordion . IsViewLoaded = true ;
1047
1110
accordion . HeaderIconPosition = ExpanderIconPosition . Start ;
1048
1111
var oldValue = ExpanderIconPosition . End ;
1049
1112
var newValue = ExpanderIconPosition . Start ;
@@ -1070,6 +1133,7 @@ public void OnAnimationEasingPropertyChanged_UpdatesAnimationEasing(ExpanderAnim
1070
1133
var accordionItem = new AccordionItem ( ) ;
1071
1134
accordion . Items . Add ( accordionItem ) ;
1072
1135
accordionItem . _accordionItemView = [ ] ;
1136
+ accordion . IsViewLoaded = true ;
1073
1137
accordion . AnimationEasing = newValue ;
1074
1138
MethodInfo ? methodInfo = typeof ( SfAccordion ) . GetMethod (
1075
1139
"OnAnimationEasingPropertyChanged" ,
@@ -1093,6 +1157,7 @@ public void OnAnimationDurationPropertyChanged_UpdatesAnimationDuration(int newV
1093
1157
var accordionItem = new AccordionItem ( ) ;
1094
1158
accordion . Items . Add ( accordionItem ) ;
1095
1159
accordionItem . _accordionItemView = [ ] ;
1160
+ accordion . IsViewLoaded = true ;
1096
1161
accordion . AnimationDuration = newValue ;
1097
1162
MethodInfo ? methodInfo = typeof ( SfAccordion ) . GetMethod (
1098
1163
"OnAnimationDurationPropertyChanged" ,
0 commit comments