Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the WPF equivalent of WinForms components?

Windows Forms allows you to develop Components, non-visual elements that can have a designer. Built-in components include the BackgroundWorker, Timer, and a lot of ADO .NET objects. It's a nice way to provide easy configuration of a complicated object, and it it enables designer-assisted data binding.

I've been looking at WPF, and it doesn't seem like there's any concept of components. Am I right about this? Is there some method of creating components (or something like a component) that I've missed?

I've accepted Bob's answer because after a lot of research I feel like fancy Adorners are probably the only way to do this.

like image 505
OwenP Avatar asked Oct 01 '08 14:10

OwenP


People also ask

Can we use WinForms in WPF?

xaml under Grid or drag and drop the WindowsFormHost tool. Step 4: Now, run the code by clicking Start at the top pane of Visual Studio 2015. This Application will allow you to enter the date in Windows Form at WPF Application. This is a basic example to work with Windows Forms on WPF (Windows Presentation Foundation).

What is the replacement for WinForms?

WPF, would be your answer to Windows Forms if you are on the . NET platform.

Is WPF same as WinForms?

Introduction. The abbreviation W.P.F simply refers to Microsoft's Windows Presentation Foundation, and WinForms is a simple concatenation of Windows Forms Applications. These are both Microsoft's Windows Applications Graphical User Interfaces that developers may use to develop Windows desktop applications.

What is the replacement for WPF?

Universal Windows Platform. Both Windows Forms and WPF are old, and Microsoft is pointing developers towards its Universal Windows Platform (UWP) instead. UWP is an evolution of the new application platform introduced in Windows 8 in 2012.


1 Answers

Just from my own observations, it seems like Microsoft is trying to move away from having components and similar things in the GUI. I think WPF tries to limit most of what's in the XAML to strictly GUI things. Data binding I guess would be the only exception. I know I try to keep most everything else in the code-behind or in separate classes or assemblies.

Probably not exactly the answer you wanted, but it's my $0.02.

like image 185
Bob Wintemberg Avatar answered Oct 15 '22 22:10

Bob Wintemberg