Skip to content

Commit 5ed34ce

Browse files
committed
Support UnPackged Uri for Composition/Win2D Samples
1 parent c007660 commit 5ed34ce

File tree

6 files changed

+40
-39
lines changed

6 files changed

+40
-39
lines changed

dev/DevWinUI.Gallery/Views/Pages/Composition/ColorShadowPage.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
ColorShadowBlurRadius="{x:Bind SldColorShadowBlurRadius.Value, Mode=OneWay}"
6565
ColorShadowOpacity="{x:Bind SldColorShadowOpacity.Value, Mode=OneWay}"
6666
ColorShadowPadding="{x:Bind SldColorShadowPadding.Value, Mode=OneWay, Converter={StaticResource DoubleToThicknessConverter}}"
67-
ImageUri="ms-appx:///Assets/Others/RainbowRose.png"
6867
IsShadowEnabled="{x:Bind TgShowShadow.IsOn, Mode=OneWay}"
6968
ShadowBlurRadius="{x:Bind SldShadowBlurRadius.Value, Mode=OneWay}"
7069
ShadowOffsetX="{x:Bind SldShadowOffsetY.Value, Mode=OneWay}"

dev/DevWinUI.Gallery/Views/Pages/Composition/ColorShadowPage.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ public sealed partial class ColorShadowPage : Page
55
public ColorShadowPage()
66
{
77
InitializeComponent();
8+
9+
ColorShadowCtrl.ImageUri = PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Others/RainbowRose.png"));
810
}
911
}

dev/DevWinUI.Gallery/Views/Pages/Composition/FluidBannerPage.xaml.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ private void FluidBannerPage_Loaded(object sender, RoutedEventArgs e)
1616
var items = new List<Uri>();
1717
for (var i = 0; i < itemCount; i++)
1818
{
19-
items.Add(new Uri($"ms-appx:///Assets/Landscapes/Landscape-{i + 1}.jpg"));
19+
items.Add(new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-{i + 1}.jpg"))));
2020
}
2121

2222
Banner.ItemsSource = items;

dev/DevWinUI.Gallery/Views/Pages/Composition/ImageFramePage.xaml.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ public ImageFramePage()
1212

1313
_uris = new List<Uri>()
1414
{
15-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-1.jpg"),
16-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-2.jpg"),
17-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-3.jpg"),
18-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-4.jpg"),
19-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-5.jpg"),
20-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-6.jpg"),
21-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-7.jpg"),
22-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-8.jpg"),
23-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-9.jpg"),
24-
new Uri($"ms-appx:///Assets/Landscapes/Landscape-10.jpg"),
15+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-1.jpg"))),
16+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-2.jpg"))),
17+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-3.jpg"))),
18+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-4.jpg"))),
19+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-5.jpg"))),
20+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-6.jpg"))),
21+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-7.jpg"))),
22+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-8.jpg"))),
23+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-9.jpg"))),
24+
new Uri(PathHelper.GetFilePath(new Uri($"ms-appx:///Assets/Landscapes/Landscape-10.jpg")))
2525
};
2626

2727
ImageFrame.Source = _uris[_currentIndex];

dev/DevWinUI.Gallery/Views/Pages/Composition/ProfileControlPage.xaml.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public ProfileControlPage()
1111

1212
_profiles = new List<Uri>
1313
{
14-
new Uri("ms-appx:///Assets/Others/p1.jpg"),
15-
new Uri("ms-appx:///Assets/Others/p2.jpg"),
16-
new Uri("ms-appx:///Assets/Others/p3.jpg"),
17-
new Uri("ms-appx:///Assets/Others/p4.jpg"),
18-
new Uri("ms-appx:///Assets/Others/p5.jpg"),
19-
new Uri("ms-appx:///Assets/Others/p6.jpg")
14+
new Uri(PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Others/p1.jpg"))),
15+
new Uri(PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Others/p2.jpg"))),
16+
new Uri(PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Others/p3.jpg"))),
17+
new Uri(PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Others/p4.jpg"))),
18+
new Uri(PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Others/p5.jpg"))),
19+
new Uri(PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Others/p6.jpg"))),
2020
};
2121

2222
currentIndex = 0;

dev/DevWinUI.Gallery/Views/Pages/Composition/StoreCarouselPage.xaml.cs

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,45 @@ public sealed partial class StoreCarouselPage : Page
88
{
99
new StoreCarouselItem
1010
{
11-
Title ="Wolverine & Deadpool",
12-
Description ="Action-packed mutant duo",
13-
ImageSource="ms-appx:///Assets/Carousel/1.jpg",
11+
Title = "Wolverine & Deadpool",
12+
Description = "Action-packed mutant duo",
13+
ImageSource= PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Carousel/1.jpg")),
1414
},
1515
new StoreCarouselItem
1616
{
17-
Title ="Alien",
18-
Description ="Survival horror in space",
19-
ImageSource="ms-appx:///Assets/Carousel/2.jpg",
17+
Title = "Alien",
18+
Description = "Survival horror in space",
19+
ImageSource= PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Carousel/2.jpg")),
2020
},
2121
new StoreCarouselItem
2222
{
23-
Title ="Walking Dead: Dead City",
24-
Description ="Zombies overrun New York",
25-
ImageSource="ms-appx:///Assets/Carousel/3.jpg",
23+
Title = "Walking Dead: Dead City",
24+
Description = "Zombies overrun New York",
25+
ImageSource= PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Carousel/3.jpg")),
2626
},
2727
new StoreCarouselItem
2828
{
29-
Title ="Inferno",
30-
Description ="Thrilling race against time",
31-
ImageSource="ms-appx:///Assets/Carousel/4.jpg",
29+
Title = "Inferno",
30+
Description = "Thrilling race against time",
31+
ImageSource= PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Carousel/4.jpg")),
3232
},
3333
new StoreCarouselItem
3434
{
35-
Title ="The Forest Song",
36-
Description ="Magical tale of nature and love",
37-
ImageSource="ms-appx:///Assets/Carousel/5.jpg",
35+
Title = "The Forest Song",
36+
Description = "Magical tale of nature and love",
37+
ImageSource= PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Carousel/5.jpg")),
3838
},
3939
new StoreCarouselItem
4040
{
41-
Title ="Moana",
42-
Description ="Epic ocean adventure",
43-
ImageSource="ms-appx:///Assets/Carousel/6.jpg",
41+
Title = "Moana",
42+
Description = "Epic ocean adventure",
43+
ImageSource= PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Carousel/6.jpg")),
4444
},
4545
new StoreCarouselItem
4646
{
47-
Title ="Avatar",
48-
Description ="Journey to Pandora",
49-
ImageSource="ms-appx:///Assets/Carousel/7.jpg",
47+
Title = "Avatar",
48+
Description = "Journey to Pandora",
49+
ImageSource= PathHelper.GetFilePath(new Uri("ms-appx:///Assets/Carousel/7.jpg")),
5050
},
5151
};
5252
public StoreCarouselPage()

0 commit comments

Comments
 (0)