microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.36k stars 678 forks source link

Proposal: C++/WinRT basic example for each control #1946

Open JohnF38 opened 4 years ago

JohnF38 commented 4 years ago

Hi,

I might be wrong but it seems there are actually quite a few C++/WinRT examples available for WinUI. It would be really nice if we had a small C++/WinRT example for main controls (button, list view,...).

Thanks John

StephenLPeters commented 4 years ago

Hey John, c++winrt could definitely benefit from more documentation. However I'm curious what exactly you are looking for with this request. We are currently brain storming some ideas but most of the controls usage, like buttons and list view, will occur in the markup for your app, not the c++ code behind. Are there specific use cases you'd like to call out?

ranjeshj commented 4 years ago

@anawishnoff @stmoy to comment about any currently available samples in WinRT/C++.

JohnF38 commented 4 years ago

Hi Stephen,

Thanks for your prompt answer. I'm actually coding for the Windows plateform using C++ and wxWidgets. I'm planning to switch to C++/WinRT and WinUI when stable V3.0 is released. Still, the Wx project has a really cool docs/examples strategy; they propose a very short coding sample for any available control or feature. This is of great help because what you're looking for isn't dissolved in a 10.000 lines sample.

Since my applications require complex handling of events but rather basic GUI controls , I don't plan to use markup but rather hard coding controls.

StephenLPeters commented 4 years ago

@JohnF38 could you link to an example that you found particularly helpful? So I can pass along the format when we propose this to the team.

JohnF38 commented 4 years ago

Hi Stephen,

Sure, easy !
You could take a look at https://github.com/wxWidgets/wxWidgets/tree/master/samples

Those samples really made my life easier when it came to understand a particular use/feature of controls. Furthermore, they're also valuable since providing some kind of starting point.

StephenLPeters commented 4 years ago

Awesome, thanks @JohnF38. I don't think we have the bandwidth to address this while we are actively working on WinUI 3.0 but this feedback will be useful once we land WinUI 3.0 and can shift focus! If you (or anyone else) is passionate about this and built your own samples I think we would consider how we could incorporate them into our documentation.

EternalSaga commented 4 years ago

I have the same proposal at present. The WinUI seems fantastic but I only can find one example of c++/winrt on the Microsoft Documentaion. I hope there are more examples and documentations for c++/winrt.

marcelwgn commented 4 years ago

Where should this proposals be? Would it be fine if those samples are available on the respective documentation pages? In that case, we might want to move this issue to the WinUI docs repo.

Or are there any other places where you would want to see such samples?

ranjeshj commented 4 years ago

The docs repro makes sense for this request I think. @chigy would you agree.

zalaps commented 4 years ago

Hello All, This is indeed necessary. We have started to migrate from MFC to C++/WinRT. Experience has been struggling for now. We have done fair amount of work on sampling of C++ controls. Let me see if I can create a sample public repo for the same.

jamespack commented 1 year ago

I just built a small sample.

https://github.com/jamespack/winrt-cpp-mvvm