Skip to content

Commit dc46907

Browse files
author
reunion-maestro-bot
committed
Syncing content from committish d71290bb0b9df8d3bbfbd2399f2e9b4ed598dd5e
1 parent de1b1d8 commit dc46907

File tree

3 files changed

+169
-15
lines changed

3 files changed

+169
-15
lines changed

src/controls/dev/IconSource/APITests/IconSourceApiTests.cs

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,5 +111,141 @@ public void AnimatedIconSourceTest()
111111
Verify.IsTrue(animatedIcon.MirroredWhenRightToLeft);
112112
});
113113
}
114+
115+
[TestMethod]
116+
public void CreateIconElementReturnsCorrectTypeTest()
117+
{
118+
RunOnUIThread.Execute(() =>
119+
{
120+
Log.Comment("Verify BitmapIconSource creates BitmapIcon");
121+
var bitmapIconSource = new BitmapIconSource();
122+
var bitmapIcon = bitmapIconSource.CreateIconElement();
123+
Verify.IsNotNull(bitmapIcon);
124+
Verify.IsTrue(bitmapIcon is BitmapIcon);
125+
126+
Log.Comment("Verify FontIconSource creates FontIcon");
127+
var fontIconSource = new FontIconSource();
128+
var fontIcon = fontIconSource.CreateIconElement();
129+
Verify.IsNotNull(fontIcon);
130+
Verify.IsTrue(fontIcon is FontIcon);
131+
132+
Log.Comment("Verify SymbolIconSource creates SymbolIcon");
133+
var symbolIconSource = new SymbolIconSource();
134+
var symbolIcon = symbolIconSource.CreateIconElement();
135+
Verify.IsNotNull(symbolIcon);
136+
Verify.IsTrue(symbolIcon is SymbolIcon);
137+
138+
Log.Comment("Verify PathIconSource creates PathIcon");
139+
var pathIconSource = new PathIconSource();
140+
var pathIcon = pathIconSource.CreateIconElement();
141+
Verify.IsNotNull(pathIcon);
142+
Verify.IsTrue(pathIcon is PathIcon);
143+
});
144+
}
145+
146+
[TestMethod]
147+
public void CreateIconElementForegroundTest()
148+
{
149+
FontIconSource iconSource1 = null;
150+
FontIconSource iconSource2 = null;
151+
FontIcon icon1 = null;
152+
FontIcon icon2 = null;
153+
154+
RunOnUIThread.Execute(() =>
155+
{
156+
iconSource1 = new FontIconSource()
157+
{
158+
Foreground = new SolidColorBrush(Microsoft.UI.Colors.Blue)
159+
};
160+
161+
iconSource2 = new FontIconSource();
162+
163+
Log.Comment("Create first icon element with foreground already set");
164+
icon1 = iconSource1.CreateIconElement() as FontIcon;
165+
Verify.IsNotNull(icon1);
166+
167+
Log.Comment("Create second icon element with foreground not set");
168+
icon2 = iconSource2.CreateIconElement() as FontIcon;
169+
Verify.IsNotNull(icon2);
170+
});
171+
172+
IdleSynchronizer.Wait();
173+
174+
RunOnUIThread.Execute(() =>
175+
{
176+
Log.Comment("Verify foreground is applied to both icon elements");
177+
Verify.IsTrue(icon1.Foreground is SolidColorBrush);
178+
Verify.IsTrue(icon2.Foreground is SolidColorBrush);
179+
Verify.AreEqual(Microsoft.UI.Colors.Blue, (icon1.Foreground as SolidColorBrush).Color);
180+
});
181+
}
182+
183+
[TestMethod]
184+
public void PropertyChangePropagationToCreatedElements()
185+
{
186+
FontIconSource iconSource = null;
187+
FontIcon icon = null;
188+
189+
RunOnUIThread.Execute(() =>
190+
{
191+
iconSource = new FontIconSource();
192+
193+
Log.Comment("Create icon element before setting properties");
194+
icon = iconSource.CreateIconElement() as FontIcon;
195+
196+
Verify.IsNotNull(icon);
197+
});
198+
199+
IdleSynchronizer.Wait();
200+
201+
RunOnUIThread.Execute(() =>
202+
{
203+
Log.Comment("Verify foreground is not null before setting");
204+
Verify.IsNotNull(icon.Foreground);
205+
206+
Log.Comment("Change foreground on IconSource");
207+
iconSource.Foreground = new SolidColorBrush(Microsoft.UI.Colors.Red);
208+
});
209+
210+
IdleSynchronizer.Wait();
211+
212+
RunOnUIThread.Execute(() =>
213+
{
214+
Log.Comment("Verify foreground propagates to created element");
215+
Verify.IsTrue(icon.Foreground is SolidColorBrush);
216+
Verify.AreEqual(Microsoft.UI.Colors.Red, (icon.Foreground as SolidColorBrush).Color);
217+
});
218+
}
219+
220+
[TestMethod]
221+
public void CreateIconElementPreservesIconSourceProperties()
222+
{
223+
FontIconSource fontIconSource = null;
224+
FontIcon fontIcon = null;
225+
226+
RunOnUIThread.Execute(() =>
227+
{
228+
fontIconSource = new FontIconSource();
229+
fontIconSource.Glyph = "\uE001";
230+
fontIconSource.FontSize = 24;
231+
fontIconSource.FontFamily = new Microsoft.UI.Xaml.Media.FontFamily("Segoe UI Symbol");
232+
fontIconSource.Foreground = new SolidColorBrush(Microsoft.UI.Colors.Purple);
233+
234+
Log.Comment("Create icon element from configured source");
235+
fontIcon = fontIconSource.CreateIconElement() as FontIcon;
236+
Verify.IsNotNull(fontIcon);
237+
});
238+
239+
IdleSynchronizer.Wait();
240+
241+
RunOnUIThread.Execute(() =>
242+
{
243+
Log.Comment("Verify all properties are transferred to the icon element");
244+
Verify.AreEqual("\uE001", fontIcon.Glyph);
245+
Verify.AreEqual(24.0, fontIcon.FontSize);
246+
Verify.AreEqual("Segoe UI Symbol", fontIcon.FontFamily.Source);
247+
Verify.AreEqual(Microsoft.UI.Colors.Purple, (fontIcon.Foreground as SolidColorBrush).Color);
248+
});
249+
}
114250
}
115251
}

src/dxaml/xcp/dxaml/lib/IconSource_Partial.cpp

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44
#include "precomp.h"
55
#include "IconElement.g.h"
66
#include "IconSource.g.h"
7+
#include "FrameworkUdk/Containment.h"
8+
9+
// Bug 60408488: [1.8 Servicing][WASDK] Fix FontIconSource.CreateFontIcon() does not render correctly
10+
11+
#define WINAPPSDK_CHANGEID_60408488 60408488, WinAppSDK_1_8_4
712

813
using namespace DirectUI;
914
using namespace DirectUISynonyms;
@@ -17,7 +22,20 @@ IFACEMETHODIMP IconSource::CreateIconElement(_Outptr_ ABI::Microsoft::UI::Xaml::
1722
{
1823
ctl::ComPtr<IBrush> foreground;
1924
IFC_RETURN(get_Foreground(&foreground));
20-
IFC_RETURN(element->put_Foreground(foreground.Get()));
25+
26+
if (WinAppSdk::Containment::IsChangeEnabled<WINAPPSDK_CHANGEID_60408488>())
27+
{
28+
// If foreground is not set, we do not set it on the element, so that it can pick up the default foreground based on theme.
29+
if (foreground)
30+
{
31+
IFC_RETURN(element->put_Foreground(foreground.Get()));
32+
}
33+
}
34+
else
35+
{
36+
// Pre-1.8.4 behavior: Always set the foreground, even if it's null.
37+
IFC_RETURN(element->put_Foreground(foreground.Get()));
38+
}
2139
}
2240

2341
ctl::WeakRefPtr weakElement;

src/eng/Version.Details.xml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,39 +2,39 @@
22
<!-- Copyright (c) Microsoft Corporation. Licensed under the MIT License. See LICENSE in the project root for license information. -->
33
<Dependencies>
44
<ProductDependencies>
5-
<Dependency Name="Microsoft.WindowsAppSDK.Foundation.TransportPackage" Version="1.8.0-20251104.0.release">
5+
<Dependency Name="Microsoft.WindowsAppSDK.Foundation.TransportPackage" Version="1.8.0-20251220.0.release">
66
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDK</Uri>
7-
<Sha>87995f7c3e6fc8d2b68eb744ecc7664211d1de82</Sha>
7+
<Sha>8d253149fa3e3bec7883149f356456769ef73fce</Sha>
88
</Dependency>
9-
<Dependency Name="Microsoft.ProjectReunion.InteractiveExperiences.TransportPackage" Version="1.8.0-stable-27108.1016.251103-2135.0">
9+
<Dependency Name="Microsoft.ProjectReunion.InteractiveExperiences.TransportPackage" Version="1.8.0-stable-27108.1025.251215-1020.4">
1010
<Uri>https://dev.azure.com/microsoft/LiftedIXP/_git/DCPP</Uri>
11-
<Sha>7c6aabdecdc2b713ad2eebc28f89f7768b9cadfe</Sha>
11+
<Sha>d064456d97fbf7841c7eafa43f81da65fd52444e</Sha>
1212
</Dependency>
13-
<Dependency Name="Microsoft.Internal.InteractiveExperiences" Version="1.8.0-stable-27108.1016.251103-2135.0">
13+
<Dependency Name="Microsoft.Internal.InteractiveExperiences" Version="1.8.0-stable-27108.1025.251215-1020.4">
1414
<Uri>https://dev.azure.com/microsoft/LiftedIXP/_git/DCPP</Uri>
15-
<Sha>7c6aabdecdc2b713ad2eebc28f89f7768b9cadfe</Sha>
15+
<Sha>d064456d97fbf7841c7eafa43f81da65fd52444e</Sha>
1616
</Dependency>
1717
<!-- Microsoft-WinUI-SDK subdirectory in WindowsAppSDKClosed (MSBuild and Visual Studio extensions for building, deploying, and debugging packaged applications.) -->
1818
<Dependency Name="Microsoft.Build.Msix" Version="1.7.0-release.20241114.0">
1919
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDKClosed</Uri>
2020
<Sha>bebdf37da96fd9d4c4a6588a8000ceee880cd373</Sha>
2121
</Dependency>
2222
<!-- Closed source binary (ex PTLS and WinUIEdit) -->
23-
<Dependency Name="Microsoft.Internal.WinUIDetails" Version="1.810.0-stable.20251104.3">
23+
<Dependency Name="Microsoft.Internal.WinUIDetails" Version="1.810.0-stable.20251218.1">
2424
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDKClosed</Uri>
25-
<Sha>62641e69715904272ae98c31c528db4742e9756c</Sha>
25+
<Sha>5f9a979a6e86dae019e8bd21b2a124f9b03e3e85</Sha>
2626
</Dependency>
27-
<Dependency Name="Microsoft.WindowsAppSDK.Base" Version="1.8.250831001">
27+
<Dependency Name="Microsoft.WindowsAppSDK.Base" Version="1.8.251216001">
2828
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDKAggregator</Uri>
29-
<Sha>094e50346aa0f06f3cb5e8fc0299849db6d00709</Sha>
29+
<Sha>66cd2dc7827ad19d84cd68743af8570d9aca1c93</Sha>
3030
</Dependency>
31-
<Dependency Name="Microsoft.WindowsAppSDK.Foundation" Version="1.8.251104000">
31+
<Dependency Name="Microsoft.WindowsAppSDK.Foundation" Version="1.8.251220000">
3232
<Uri>https://dev.azure.com/microsoft/ProjectReunion/_git/WindowsAppSDK</Uri>
33-
<Sha>87995f7c3e6fc8d2b68eb744ecc7664211d1de82</Sha>
33+
<Sha>8d253149fa3e3bec7883149f356456769ef73fce</Sha>
3434
</Dependency>
35-
<Dependency Name="Microsoft.WindowsAppSDK.InteractiveExperiences" Version="1.8.251104001">
35+
<Dependency Name="Microsoft.WindowsAppSDK.InteractiveExperiences" Version="1.8.251217001">
3636
<Uri>https://dev.azure.com/microsoft/LiftedIXP/_git/DCPP</Uri>
37-
<Sha>7c6aabdecdc2b713ad2eebc28f89f7768b9cadfe</Sha>
37+
<Sha>d064456d97fbf7841c7eafa43f81da65fd52444e</Sha>
3838
</Dependency>
3939
</ProductDependencies>
4040
<ToolsetDependencies>

0 commit comments

Comments
 (0)