3 ms·
In WPF you can completely sidestep XAML and get direct access to the rendering engine to run your own measure, arrange, and drawing code. Can you do that in Rea
by m0ther 9y ago
In WPF you can completely sidestep XAML and get direct access to the rendering engine to run your own measure, arrange, and drawing code. Can you do that in React? If not, WPF is what WPF should have been.
XAML is WPF in easy mode.
- mikewhy 9y agoWouldn't that just be JavaScript?
- m0ther 9y agoNo. Is the react rendering engine rendered by Html5 Canvas or WebGL? That would be the closest analogue. In WPF you can get direct access to their retained mode graphics system, built on top of direct x, and ignore XAML completely. Before making a claim like "React is what WPF should have been", the author should have done a lot more research into what WPF is and what could be done with it. The beauty of WPF isn't in XAML, it is in WPF's underlying framework and rendering engine. XAML is WPF's training wheels.
- kitsunesoba 9y agoHow flexible is this "sidestepping"? Could one build an implementation of another UI toolkit (like Cocoa) on top of it?
- douche 9y agoYou can park a DirectX context in a WPF window or control. From there it is off to the races, implementing anything you can imagine from scratch.
- m0ther 9y agoI don't understand why Microsoft has been keeping this a secret for so long. If you want a taste of what can be done in WPF when you take the training wheels off; find yourself a copy of the now discontinued Windows Media Center. It's UI is built on WPF. It's such a shame WPF is in maintenance mode instead of active development. I'd imagine a big reason for that is that it didn't gain the level of popularity Microsoft hoped it would. I don't think they did a good job of explaining and evangelizing it since release. UWP/Win2d seems to be what was meant to replace it, but it doesn't offer the same level of control and compatibility at all. I'm sure there's some grand long term plan I'm not privy to, but I'd be much happier in the short term if we could stop pushing windows store apps and get back to building frameworks for the hardcore. Did you know there was a managed version of DirectX 9? Have you looked into C++/CLI? I'd love to understand the story of why the .net initiative changed direction in the last decade. I'd love to hear the master plan.
- pjmlp 9y agoThe master plan is very easy to explain by any long time Windows developer (back to 3.x days). The political wars between WinDev (Windows and C/C++) and DevTools (Visual Studio and .NET) divisions. With the mismanagemnt that happened with Longhorn, the WinDev gained in strenght Vista and Windows 7 happened, pushing aside all .NET related plans into DevTools alone. Then with the failure of the initial store model, the DevTools kind of won in strenght got some of the ex-Midori devs, MDIL compiler became .NET Native and at the last couple of BUILDs you very barely see any talk about using C++ for UWP, rather portability across Linux/mobile OSes and ANSI C++ compatibility, everything else is shown in C#.
- m0ther 9y agohttps://msdn.microsoft.com/en-us/library/system.windows.media.drawingcontext(v=vs.110).aspx https://msdn.microsoft.com/en-us/library/system.windows.medi... You can build whatever you want on top of the WPF foundation. That's how .net framework API's work. WPF is a rendering engine, with a control management system build on top of it. XAML is an HTML like way of defining controls, but you don't have to use it. XAML is sugar, and I generally avoid it unless my application is super simple. You don't have to use their control management system either, you can go strait for the retained mode graphics system. As much as Microsoft tries to make windows development look like web development through sugar on top (XAML is the most recent) to attract the new generation of web only developers, it's not. There's a lot of depth, performance, and control to be had there. If you want to see what I'm talking about, get visual studio community edition (if you don't have visual studio already) and spend a weekend with WPF without XAML. I think you'll be surprised with how much fun you can have, and the level of control you can take. Make your own controls, override measure, arrange, and render.