Skip to content

Commit 1ce7a87

Browse files
committed
Normailize qulified names
1 parent c9b46c0 commit 1ce7a87

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

Microsoft.Toolkit.Uwp.UI.Controls/TileControl/TileControl.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,13 @@ private void CreateModuloExpression(ScrollViewer scrollViewer, double imageWidth
440440
{
441441
const string propSetParam = "p";
442442
const string offsetXParam = "offsetX";
443+
const string qualifiedOffsetXParam = propSetParam + "." + offsetXParam;
443444
const string offsetYParam = "offsetY";
445+
const string qualifiedOffsetYParam = propSetParam + "." + offsetYParam;
444446
const string imageWidthParam = "imageWidth";
447+
const string qualifiedImageWidthParam = propSetParam + "." + imageWidthParam;
445448
const string imageHeightParam = "imageHeight";
449+
const string qualifiedImageHeightParam = propSetParam + "." + imageHeightParam;
446450
const string speedParam = "speed";
447451

448452
if (_containerVisual == null)
@@ -481,24 +485,26 @@ string Thing(string common, string diemtion)
481485
if (scrollViewer == null)
482486
{
483487
// 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);
485489

486-
expressionYVal = Thing("Ceil(" + propSetParam + "." + offsetYParam + ")", propSetParam + "." + imageWidthParam);
490+
expressionYVal = Thing("Ceil(" + qualifiedOffsetYParam + ")", qualifiedImageWidthParam);
487491
}
488492
else
489493
{
490494
// expressions are created to simulate a positive and negative modulo with the size of the image and the offset and the ScrollViewer offset (Translation)
491495
var scrollProperties = ElementCompositionPreview.GetScrollViewerManipulationPropertySet(scrollViewer);
492496
const string scrollParam = "s";
497+
const string qualifiedSpeedParam = propSetParam + "." + speedParam;
498+
493499
expressionX.SetReferenceParameter(scrollParam, scrollProperties);
494500
expressionY.SetReferenceParameter(scrollParam, scrollProperties);
495501

496502
string LocalThing(string scroll, string speed, string offset, string dimention)
497503
=> Thing(string.Format("Ceil(({0} * {1}) + {2})", scroll, speed, offset), dimention);
498504

499-
expressionXVal = LocalThing(scrollParam + ".Translation.X", propSetParam + "." + speedParam, propSetParam + "." + offsetXParam, propSetParam + "." + imageWidthParam);
505+
expressionXVal = LocalThing(scrollParam + ".Translation.X", qualifiedSpeedParam, qualifiedOffsetXParam, qualifiedImageWidthParam);
500506

501-
expressionYVal = LocalThing(scrollParam + ".Translation.Y", propSetParam + "." + speedParam, propSetParam + "." + offsetYParam, propSetParam + "." + imageHeightParam);
507+
expressionYVal = LocalThing(scrollParam + ".Translation.Y", qualifiedSpeedParam, qualifiedOffsetYParam, qualifiedImageHeightParam);
502508
}
503509

504510
if (scrollOrientation == ScrollOrientation.Horizontal || scrollOrientation == ScrollOrientation.Both)

0 commit comments

Comments
 (0)