(Winui3/C++) How to correctly initialize the data of the window class (e.g., MainWindow).
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
Research direction
Start with the MainWindow constructor and the referenced C++/WinRT InitializeComponent guidance. Determine the appropriate post-initialization point for sourceList().ItemsSource(sourceArray), then verify that the window initializes without the reported error.
Written by the indexing model from the issue text.
Description
C++ WinUI 3 examples are really scarce.
I need to initialize the following code:
sourceList().ItemsSource(sourceArray);
struct MainWindow : MainWindowT<MainWindow>
{
MainWindow()
{
// Xaml objects should not call InitializeComponent during construction.
// See https://github.com/microsoft/cppwinrt/tree/master/nuget#initializecomponent
//When I initialize here, an error occurs. I think it's because the component is not fully initialized.
sourceList().ItemsSource(sourceArray);
}
...
Where should I elegantly and right implement the initialization of this code?
- Dominant language
- PowerShell
- Stars
- 1k
- Forks
- 336
- Avg merge
- 7h 13m
- Merged PRs (30d)
- 3
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/WindowsAppSDK-Samples
-
"Samples\Content\cpp-win32\Squares\Squares.vcxproj" doesn't configure precompiled headers correctlyOpen
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
[WinML] Dependency resolution issues w/ Python sampleMay be free again @adrastogi claimed this 233 days ago, and no pull request is open. Open
microsoft/WindowsAppSDK-Samples#595 · 1 assignee ·
-
Difficulty 4/5 3-5 days Newbie friendliness 28/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 25/100
microsoft/WindowsAppSDK-Samples#580 · 1 comment ·
All issues in microsoft/WindowsAppSDK-Samples
Similar issues
-
effort:S priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
area: desktop area: website priority: P2 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
appandflow/stim#3411 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
randheimer/PDF-Fusion#13 ·
Maintainers usually reply within 1 day
-
优化导入 OCR 模型选择文件的按钮样式Open
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
siyuan-note/siyuan#20430 · 1 comment ·
Maintainers usually reply within 1 day
-
Example good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 85/100