@@ -439,15 +439,15 @@ private async Task CreateModuloExpression(ScrollViewer scrollViewer = null)
439
439
private void CreateModuloExpression ( ScrollViewer scrollViewer , double imageWidth , double imageHeight , ScrollOrientation scrollOrientation )
440
440
{
441
441
const string propSetParam = "p" ;
442
- const string offsetXParam = "offsetX" ;
442
+ const string offsetXParam = nameof ( OffsetX ) ;
443
443
const string qualifiedOffsetXParam = propSetParam + "." + offsetXParam ;
444
- const string offsetYParam = "offsetY" ;
444
+ const string offsetYParam = nameof ( OffsetY ) ;
445
445
const string qualifiedOffsetYParam = propSetParam + "." + offsetYParam ;
446
- const string imageWidthParam = " imageWidth" ;
446
+ const string imageWidthParam = nameof ( imageWidth ) ;
447
447
const string qualifiedImageWidthParam = propSetParam + "." + imageWidthParam ;
448
- const string imageHeightParam = " imageHeight" ;
448
+ const string imageHeightParam = nameof ( imageHeight ) ;
449
449
const string qualifiedImageHeightParam = propSetParam + "." + imageHeightParam ;
450
- const string speedParam = "speed" ;
450
+ const string speedParam = nameof ( ParallaxSpeedRatio ) ;
451
451
452
452
if ( _containerVisual == null )
453
453
{
@@ -494,6 +494,7 @@ string Thing(string common, string dimension)
494
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)
495
495
var scrollProperties = ElementCompositionPreview . GetScrollViewerManipulationPropertySet ( scrollViewer ) ;
496
496
const string scrollParam = "s" ;
497
+ const string translationParam = scrollParam + "." + nameof ( scrollViewer . Translation ) ;
497
498
const string qualifiedSpeedParam = propSetParam + "." + speedParam ;
498
499
499
500
expressionX . SetReferenceParameter ( scrollParam , scrollProperties ) ;
@@ -502,9 +503,9 @@ string Thing(string common, string dimension)
502
503
string LocalThing ( string scroll , string speed , string offset , string dimension )
503
504
=> Thing ( string . Format ( "Ceil(({0} * {1}) + {2})" , scroll , speed , offset ) , dimension ) ;
504
505
505
- expressionXVal = LocalThing ( scrollParam + ".Translation.X" , qualifiedSpeedParam , qualifiedOffsetXParam , qualifiedImageWidthParam ) ;
506
+ expressionXVal = LocalThing ( translationParam + "." + nameof ( scrollViewer . Translation . X ) , qualifiedSpeedParam , qualifiedOffsetXParam , qualifiedImageWidthParam ) ;
506
507
507
- expressionYVal = LocalThing ( scrollParam + ".Translation.Y" , qualifiedSpeedParam , qualifiedOffsetYParam , qualifiedImageHeightParam ) ;
508
+ expressionYVal = LocalThing ( translationParam + "." + nameof ( scrollViewer . Translation . Y ) , qualifiedSpeedParam , qualifiedOffsetYParam , qualifiedImageHeightParam ) ;
508
509
}
509
510
510
511
if ( scrollOrientation == ScrollOrientation . Horizontal || scrollOrientation == ScrollOrientation . Both )
0 commit comments