areweguiyet / areweguiyet

A website built for the Rust community

Home Page:http://areweguiyet.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add Windows XAML UI

eadordzhiev opened this issue · comments

Is XAML even possible in the current state?

I think this issue is tracking the current state microsoft/microsoft-ui-xaml#2488

The Windows Runtime API is basically a lightweight COM. The API can be consumed by any language with the C FFI, Rust including.
Microsoft provides official Rust bindings for Win32 and Windows Runtime https://github.com/microsoft/winrt-rs.

The official announcement blog post with a sample project https://blogs.windows.com/windowsdeveloper/2020/04/30/rust-winrt-public-preview/

The proposal you provided is for WinUI 3, which is a custom controls library for the XAML UI.

Just out of curiosity what can i build with XAML so far (without WinUI 3). I am a Linux user so i don't know much about the UI story in Windows. I am just curious what the relationship between the two is. Can i build "normal" GUIs with XAML now, say simple buttons, input fields, lists, tree views etc. and WinUI 3 would support more "fancy" elements (i thinks they're called controls?). I tried NWG which is a wrapper around the classic Win32 UI and i would love to spend a weekend playing with it.

Most of the Windows 10 UI is built with XAML UI, even the start menu and taskbar. You can build pretty much everything, you might not even need WinUI 3 for simple applications. But the upcoming version allows to you controls introduced in newer Windows releases in older, these are backported.
The winrt-rs allows you to consume any .winmd package, WinUI 3 including.

Do you have any example (link to blogposts or repos) presenting a simple example, like a label changed at a button click because i am just wondering what this issue microsoft/windows-rs#81 (and the associate microsoft/windows-rs#745) is about. Is it to enable easier usage or working with it altogether? I am wondering what this crate is about https://crates.io/crates/windows-ui/0.7.0 looks like its a placeholder from the owner of windows-rs. I just don't feel like its at a "user friendly" stage with "just" what is available now – but i haven't really looked into it yet and from the first glance i am unsure how to even start (when i try to attempt to build something hopefully this weekend) ... i found this https://github.com/Perlmint/xaml-island-rs-example which may or may not work as a rough starting point.

I've added windows-rs in #124 since it is still useful for the lower-level stuff / non-XAML GUI stuff.

If a crate appears that makes XAML / Windows UI development easier, we can add it then.