You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using SettingsExpander in a WinUI application with AOT mode enabled crashes the program.
在 WinUI 应用中使用 SettingsExpander,并启用 AOT 模式,程序出现崩溃
Steps to reproduce
Method to reproduce the error:
1. Use VS2022 to create a WinUI application.
2. Add a reference to SettingsExpander and add the AOT release to the project file.
3. Replace the default code with the following code and run it
复现错误的方法:
1. 使用 VS2022 创建一个 WinUI 应用
2. 添加对于 SettingsExpander 的引用,并在项目文件中添加 AOT 发布
3. 使用以下代码替换默认的代码并运行
<controls:SettingsExpander
x:Name="ClearBrowsingDataButton"
Header="选择每次关闭浏览器时要清除的内容">
<controls:SettingsExpander.ItemTemplate>
<DataTemplate x:DataType="local:BrowserDataKind">
<controls:SettingsCard Header="{x:Bind Name}">
<ToggleSwitch IsOn="{x:Bind IsChecked, Mode=TwoWay}"/>
</controls:SettingsCard>
</DataTemplate>
</controls:SettingsExpander.ItemTemplate>
</controls:SettingsExpander>
namespace WinUIDemo
{
public class BrowserDataKind
{
public string Name { get; set; }
public bool IsChecked { get; set; } = false;
}
public sealed partial class MainWindow : Window
{
public List<BrowserDataKind> BrowserDataKindList =
[
new() { Name = "浏览历史记录" },
new() { Name = "下载历史记录" },
new() { Name = "Cookies 和其他站点数据" },
new() { Name = "缓存的图像和文件" },
new() { Name = "密码" },
new() { Name = "自动填充表单数据(包括表单和卡)" },
new() { Name = "站点权限" },
];
public MainWindow()
{
this.InitializeComponent();
ClearBrowsingDataButton.ItemsSource = BrowserDataKindList;
}
}
}
Expected behavior
The code is expected to run correctly. When I replace SettingsExpander with ListView, the code works fine, so I think it might be a bug in SettingsExpander.
Describe the bug
Using SettingsExpander in a WinUI application with AOT mode enabled crashes the program.
在 WinUI 应用中使用 SettingsExpander,并启用 AOT 模式,程序出现崩溃
Steps to reproduce
Expected behavior
The code is expected to run correctly. When I replace SettingsExpander with ListView, the code works fine, so I think it might be a bug in SettingsExpander.
预期代码能够正常运行。当我将 SettingsExpander 替换为 ListView 时,代码正常工作,因此我认为,这或许是 SettingsExpander 的 bug
Screenshots
No response
Code Platform
Windows Build Number
Other Windows Build number
Windows 11 24H2 (Build 26100)
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
17.12.3
Device form factor
Desktop
Additional context
Dependencies used in the project:
项目中使用的依赖版本:
Microsoft.WindowsAppSDK: 1.6.241114003
CommunityToolkit.WinUI.Controls.SettingsControls: 8.2.241112-preview1
Help us help you
Yes, I'd like to be assigned to work on this item.
The text was updated successfully, but these errors were encountered: