Live data from Hacker News

Windows Presentation Foundation (WPF) on GitHub

github.com

51–60 of 102 posts

Re: Windows Presentation Foundation (WPF) on GitHub

#51

What would be required to make it work on Linux? Which layers would have to be reimplemented to use Linux graphical toolkit?

From what I understand, it's just a wrapper around the GDI, so implementing WPF on Linux means re-implementing the GDI.

Kitbashing this with winelib will probably be the best way to do it.

Re: Windows Presentation Foundation (WPF) on GitHub

#52
post #33

Earlier quoted context omitted.

I still don’t understand why instead of evolving WPF MS keeps cranking out similar but incompatible XAML frameworks like Silverlight, WinRT and UWP. If they had stuck to WPF and made the syntax less verbose and easier to understand and fixed some other warts WPF would be a kick ass development tool.

Because WPF is .NET based and internal Microsoft teams with C++ codebases (like Windows and Office) didn't want to take a dependency on .NET (or rather they tried with Longhorn and couldn't make it work).

That's a big issue but it doesn't explain why instead of developing WPF they released WinRT and UWP.

Re: Windows Presentation Foundation (WPF) on GitHub

#53
post #51

What would be required to make it work on Linux? Which layers would have to be reimplemented to use Linux graphical toolkit?

From what I understand, it's just a wrapper around the GDI, so implementing WPF on Linux means re-implementing the GDI. Kitbashing this with winelib will probably be the best way to do it.

Maybe there's a way to use hrml canvas instead?

Re: Windows Presentation Foundation (WPF) on GitHub

#54
post #30

When I had the chance to use it seriously many years ago, what I found about WPF is that once you got the hang of it, you could literally look at any sufficiently complex application UI and know immediately how to build it using WPF in record time. It's that composable.

Agreed. People are complaining about it in this thread, but I thought it was almost on par with Cocoa, overall. Just like Cocoa, you have to "drink the Kool-aid" a bit and decide to structure your application to match the framework rather than adapt the framework to match your preconceived notion of how your application should be structured. Once you did, You could get a lot of work done. Personally think that these…

After using Cocoa for about 10 years and React for maybe 1-2 years, I'd say that React is way easier for visual customization and hierarchy. Cocoa's hierarchy is more efficient but at a cost of being more verbose and tedious. But Cocoa was never meant to be very easy to visually customize, since part of the Apple Way ™ is that everything looks and works the same, which was probably a reaction to the over-customization of the 90s and early 2000s, but tends to go against the grain in modern UI where every application has its own branded UI that basically requires the composeability and simplicity of HTML + CSS.

Edit: also, nobody wants or uses native desktop apps anymore, so that's a big plus for React (either via Electron or just plain web app)

Re: Windows Presentation Foundation (WPF) on GitHub

#55
post #19

Earlier quoted context omitted.

Modern js frameworks makes mvvm/similar quite pleasant. Some of the binding in WPF is quite complex, especially since you don't get proper type safety for all that effort (there is a lot of stringly typed things sticking out). On the other hand, the layout model of WPF is a lot easier than mastering html+css. JS desktop apps still mostly don't work without embedding a browser like electron and that ranges from annoyi…

WPF never quite made the leap from data-binding and MVVM to a component-based + state-management architecture like React&friends. A consequence of that is a hairy overcomplicated mess of a binding system that's full of footguns. But it was still ahead of its time - that one last step would have made it amazing.

> binding system that's full of footguns

Please elaborate?

Re: Windows Presentation Foundation (WPF) on GitHub

#56

Compared to winforms, WPF has an incredibly steep learning curve. Working with it was always painful to me. The vector graphics architecture they mention makes it even harder. While it's rich capabilities enable you to implement everything you can dream of, doesn't the same hold for JS desktop apps? (+ they are cross platform) I don't see the use case anymore...

Modern js frameworks makes mvvm/similar quite pleasant. Some of the binding in WPF is quite complex, especially since you don't get proper type safety for all that effort (there is a lot of stringly typed things sticking out). On the other hand, the layout model of WPF is a lot easier than mastering html+css. JS desktop apps still mostly don't work without embedding a browser like electron and that ranges from annoyi…

> Some of the binding in WPF is quite complex, especially since you don't get proper type safety for all that effort (there is a lot of stringly typed things sticking out).

You can add a design time view model to get compile time warnings(and autocomplete) about incorrect bindings.

Re: Windows Presentation Foundation (WPF) on GitHub

#57
post #39

Earlier quoted context omitted.

What evolutions are you looking for that aren't covered in their .NET Core/.NET 5 plan?

Debugging data binding is hard. There could be a tighter coupling and type safety between view model and view. MVVM could be better integrated. The syntax generally could be simplified (MVC did this when they introduced Razor). There is a lot of room for improvement. The foundation is very good but very hard to learn and you need a ton of obscure little tricks. The .NET 5 doesn’t address any of these. They do a lot o…

I mentioned this elsewhere in the thread but you can get compile time warnings and autocomplete on data binding by adding a design time view model.

Re: Windows Presentation Foundation (WPF) on GitHub

#59
post #52

Earlier quoted context omitted.

Because WPF is .NET based and internal Microsoft teams with C++ codebases (like Windows and Office) didn't want to take a dependency on .NET (or rather they tried with Longhorn and couldn't make it work).

That's a big issue but it doesn't explain why instead of developing WPF they released WinRT and UWP.

The purpose of WinRT was to avoid having to depend on .NET. Developing WPF to fix this would have meant rewriting the whole thing in C++, which is what Silverlight/WinUI sort of was, but I agree they dropped the ball on compatibility and migration

Re: Windows Presentation Foundation (WPF) on GitHub

#60
post #36
post #34

Reading this official Xamarin Forms document https://docs.microsoft.com/en-us/xamarin/cross-platform/desk... It's really hard to tell how the 2 offerings from Microsoft differs. It looks like Xamarin Forms is fairly mature, and supports Mac and Windows. Does anyone have production experience on both? When sould one choose one over another?

Maybe things have changed but my company did a Xamarin test two years ago and the results were horrible. They quickly went back to native apps.

It's still being worked on and is a good bit better than 2 years ago but still has a couple of warts. To be fair all of the cross platform mobile applications have quite a few warts :).
Post reply on HN