Questions tagged [wpf]

Windows Presentation Foundation, or WPF, is a subsystem for rendering user interfaces in Windows-based applications.

Windows Presentation Foundation (WPF, previously known as “Avalon”) is part of the Microsoft .NET Framework used to create rich client user experiences for Windows applications. It is also considered as the successor to

It features a diverse set of controls, layout options, 2D and 3D graphics, media and text handling and enables data binding and style-driven templates.

It uses a combination of XAML, an XML-based markup language, and any of the Common Language Runtime languages to define user interface elements. A fundamental aspect of WPF is to separate the user interface definition from the business logic, which enables developers and designers to work concurrently on a single project much more easily. It enables the users to build a loosely coupled application with the use of data bindings effectively. WPF also moves UI rendering off to the video hardware through the use of . Doing so allows computers to utilize their GPU, which frees the CPU to handle more of the logic-oriented tasks.

WPF runtime libraries are included in all versions of Windows, since Windows Vista and Windows Server 2008.

To learn more, visit the WPF portal on MSDN. See also the Wikipedia entry on WPF.

WPF employs XAML, an XML-based language, to define and link various UI elements. WPF applications can also be deployed as standalone desktop programs, or hosted as an embedded object in a website. WPF aims to unify a number of common user interface elements, such as 2D/3D rendering, fixed and adaptive documents, typography, vector graphics, runtime animation, and pre-rendered media. These elements can then be linked and manipulated based on various events, user interactions, and data bindings.

Microsoft has released six major WPF versions:

  • WPF 4.6 (July 2015)
  • WPF 4.5 (August 2012)
  • WPF 4 (April 2010)
  • WPF 3.5SP1 (Aug 2008)
  • WPF 3.5 (Nov 2007)
  • WPF 3.0 (Nov 2006)

In future, the WPF runtime libraries will be provided by Microsoft as packages known as "App Local" in order for updates to be released independently of .NET Framework releases.

Breaking Changes

On December, 2018 WPF, WinForms and WinUI frameworks became another part of open source community, as announced by Microsoft. WinForms and WinUI are already open, and WPF is starting with System.XAML, and more changes will be announced during the 2019.

Resources

Visual Studio Extensions for WPF Controls

Chat Room

168897 questions
31
votes
3 answers

Application is not supported in a Windows Presentation Foundation (WPF) project

I've just created a new WPF project in the blend, pushed it on git, added mqsql drivers, rest service and nfc sdk and suddenly blend tells me that Application is not supported. The error leads me to App.xaml which is entirely unedited and looks…
user3106891
  • 437
  • 1
  • 4
  • 7
31
votes
3 answers

remove red rectangle around combobox

i need to remove red rectangle around combobox. I have setup combobox in xaml like (below) this and i`m trying to override of the Validation.ErrorTemplate.
vikox
  • 347
  • 1
  • 3
  • 7
31
votes
4 answers

Restart application using C#

How can I restart my WPF application using C#?
kartal
  • 17,436
  • 34
  • 100
  • 145
31
votes
2 answers

WPF Sentinel objects and how to check for an internal type

As some of you have discovered, a new feature (?) appeared WPF 4, where the data binding engine may pass your custom control instances of the class MS.Internal.NamedObject with the name "{DisconnectedItem}" into the DataContext - instead of the data…
Tor Haugen
  • 19,509
  • 9
  • 45
  • 63
31
votes
4 answers

how use icon [Font-awesome] in WPF

I am new in WPF. I want to use Font-awesome Icon in textbox and button. but the icon is not bind with my textbox I install Font-awesome resource to my application. Let me know the way how can I use it Thank You, I really need it please help…
shivani
  • 980
  • 1
  • 8
  • 29
31
votes
3 answers

BitmapSource from file

How can I load a BitmapSource from an image file?
in4man
  • 351
  • 1
  • 3
  • 6
31
votes
7 answers

DataGridTextColumn.IsReadOnly seems to be faulty

If I create a binding to the IsReadOnly property of the DataGridTextColumn, it does not actualize. If I set it through markup, it works.
HCL
  • 36,053
  • 27
  • 163
  • 213
31
votes
4 answers

Two-way binding in WPF

I cannot get a two-way bind in WPF to work. I have a string property in my app's main window that is bound to a TextBox (I set the mode to "TwoWay"). The only time that the value of the TextBox will update is when the window initializes. When I…
evizaer
  • 1,583
  • 3
  • 14
  • 17
31
votes
4 answers

WPF Tooltip Visibility

How can I ensure that a button's Tooltip is only visible when the button is disabled? What can I bind the tooltip's visibility to?
David Ward
  • 3,739
  • 10
  • 44
  • 66
31
votes
4 answers

LoadFromContext Occurred

I have a very simple C# problem that loads a Windows WPF window from a library. Here's the code: public partial class App : Application { public App() { MainWindow mainWindow = new MainWindow(); mainWindow.Show(); …
Jason
  • 13,563
  • 15
  • 74
  • 125
31
votes
6 answers

Add WPF control at runtime

I've written a WPF UserControl, and want to add one or more of it to my Window at runtime when I click a button. How can I do that? Edit: Further specification I want to add the usercontrols to a Canvas, and put in a absolute position. The canvas is…
Frode Lillerud
  • 7,324
  • 17
  • 58
  • 69
31
votes
6 answers

Simplest way to create busy animation in WPF

I mentioned that there is no standard busy control in WPF. So what's the easiest way to display animated busy circle (not progress bar) such as your browser displays when loading a page ? Please if you suggest downloading control from internet make…
Rasto
  • 17,204
  • 47
  • 154
  • 245
31
votes
2 answers

How can i specify a designer datacontext for a style, so Resharper finds my properties?

I often bind the IsExpanded and IsSelected properties of a TreeViewItem to my viewmodel. This for example makes it possible to make an item pre-expanded when the tree is loaded or expand an item when it gets selected. The XAML looks like…
JCH2k
  • 3,361
  • 32
  • 25
31
votes
6 answers

ReSharper warnings with MVVM

As I implement the MVVM pattern with WPF, I'm finding that ReSharper is often warning me that certain properties are never used in my ViewModels. The problem is that they are being used, but only by the data binding system. Has anyone else…
Dan Bryant
  • 27,329
  • 4
  • 56
  • 102
31
votes
7 answers

WPF: Is there a built-in TreeGrid / TreeListView?

I need something just like this: (I need both the TreeView and the ListView aspects. That is, Hirearchy and Columns.) But, I need it in WPF. is this something that is built in, or am I going to have to build it myself? I assume it has to be…
John Gietzen
  • 48,783
  • 32
  • 145
  • 190
1 2 3
99
100