@@ -440,9 +440,13 @@ private void CreateModuloExpression(ScrollViewer scrollViewer, double imageWidth
440
440
{
441
441
const string propSetParam = "p" ;
442
442
const string offsetXParam = "offsetX" ;
443
+ const string qualifiedOffsetXParam = propSetParam + "." + offsetXParam ;
443
444
const string offsetYParam = "offsetY" ;
445
+ const string qualifiedOffsetYParam = propSetParam + "." + offsetYParam ;
444
446
const string imageWidthParam = "imageWidth" ;
447
+ const string qualifiedImageWidthParam = propSetParam + "." + imageWidthParam ;
445
448
const string imageHeightParam = "imageHeight" ;
449
+ const string qualifiedImageHeightParam = propSetParam + "." + imageHeightParam ;
446
450
const string speedParam = "speed" ;
447
451
448
452
if ( _containerVisual == null )
@@ -481,24 +485,26 @@ string Thing(string common, string diemtion)
481
485
if ( scrollViewer == null )
482
486
{
483
487
// expressions are created to simulate a positive and negative modulo with the size of the image and the offset
484
- expressionXVal = Thing ( "Ceil(" + propSetParam + "." + offsetXParam + " )", propSetParam + "." + imageHeightParam ) ;
488
+ expressionXVal = Thing ( "Ceil(" + qualifiedOffsetXParam + ")" , qualifiedImageHeightParam ) ;
485
489
486
- expressionYVal = Thing ( "Ceil(" + propSetParam + "." + offsetYParam + " )", propSetParam + "." + imageWidthParam ) ;
490
+ expressionYVal = Thing ( "Ceil(" + qualifiedOffsetYParam + ")" , qualifiedImageWidthParam ) ;
487
491
}
488
492
else
489
493
{
490
494
// expressions are created to simulate a positive and negative modulo with the size of the image and the offset and the ScrollViewer offset (Translation)
491
495
var scrollProperties = ElementCompositionPreview . GetScrollViewerManipulationPropertySet ( scrollViewer ) ;
492
496
const string scrollParam = "s" ;
497
+ const string qualifiedSpeedParam = propSetParam + "." + speedParam ;
498
+
493
499
expressionX . SetReferenceParameter ( scrollParam , scrollProperties ) ;
494
500
expressionY . SetReferenceParameter ( scrollParam , scrollProperties ) ;
495
501
496
502
string LocalThing ( string scroll , string speed , string offset , string dimention )
497
503
=> Thing ( string . Format ( "Ceil(({0} * {1}) + {2})" , scroll , speed , offset ) , dimention ) ;
498
504
499
- expressionXVal = LocalThing ( scrollParam + ".Translation.X" , propSetParam + "." + speedParam , propSetParam + "." + offsetXParam , propSetParam + "." + imageWidthParam ) ;
505
+ expressionXVal = LocalThing ( scrollParam + ".Translation.X" , qualifiedSpeedParam , qualifiedOffsetXParam , qualifiedImageWidthParam ) ;
500
506
501
- expressionYVal = LocalThing ( scrollParam + ".Translation.Y" , propSetParam + "." + speedParam , propSetParam + "." + offsetYParam , propSetParam + "." + imageHeightParam ) ;
507
+ expressionYVal = LocalThing ( scrollParam + ".Translation.Y" , qualifiedSpeedParam , qualifiedOffsetYParam , qualifiedImageHeightParam ) ;
502
508
}
503
509
504
510
if ( scrollOrientation == ScrollOrientation . Horizontal || scrollOrientation == ScrollOrientation . Both )
0 commit comments