@@ -523,6 +523,68 @@ public void ItemsProperty_SetItems_TriggersOnItemsPropertyChanged()
523523 Assert . Equal ( 2 , itemsFromProperty . Count ) ;
524524 }
525525
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+
526588 #endregion
527589
528590 #region Methods
@@ -1044,6 +1106,7 @@ public void OnHeaderIconPositionPropertyChanged_UpdatesIconPosition()
10441106 var accordionItem = new AccordionItem ( ) ;
10451107 accordion . Items . Add ( accordionItem ) ;
10461108 accordionItem . _accordionItemView = [ ] ;
1109+ accordion . IsViewLoaded = true ;
10471110 accordion . HeaderIconPosition = ExpanderIconPosition . Start ;
10481111 var oldValue = ExpanderIconPosition . End ;
10491112 var newValue = ExpanderIconPosition . Start ;
@@ -1070,6 +1133,7 @@ public void OnAnimationEasingPropertyChanged_UpdatesAnimationEasing(ExpanderAnim
10701133 var accordionItem = new AccordionItem ( ) ;
10711134 accordion . Items . Add ( accordionItem ) ;
10721135 accordionItem . _accordionItemView = [ ] ;
1136+ accordion . IsViewLoaded = true ;
10731137 accordion . AnimationEasing = newValue ;
10741138 MethodInfo ? methodInfo = typeof ( SfAccordion ) . GetMethod (
10751139 "OnAnimationEasingPropertyChanged" ,
@@ -1093,6 +1157,7 @@ public void OnAnimationDurationPropertyChanged_UpdatesAnimationDuration(int newV
10931157 var accordionItem = new AccordionItem ( ) ;
10941158 accordion . Items . Add ( accordionItem ) ;
10951159 accordionItem . _accordionItemView = [ ] ;
1160+ accordion . IsViewLoaded = true ;
10961161 accordion . AnimationDuration = newValue ;
10971162 MethodInfo ? methodInfo = typeof ( SfAccordion ) . GetMethod (
10981163 "OnAnimationDurationPropertyChanged" ,
0 commit comments