Questions tagged [wpf-4.0]

Version 4.0 of the Windows Presentation Foundation (WPF).

New and enhanced features in WPF 4:

  • New Controls
  • Visual State Manager
  • Touch and Manipulation
  • Graphics and Animations
  • Text Binding
  • XAML Browser Applications
  • WPF and Windows
  • WPF and Silverlight Designer
424 questions
242
votes
4 answers

Difference between ObservableCollection and BindingList

I want to know the difference between ObservableCollection and BindingList because I've used both to notify for any add/delete change in Source, but I actually do not know when to prefer one over the other. Why would I choose one of the following…
Azhar
  • 19,214
  • 38
  • 134
  • 202
64
votes
7 answers

Disable DataGrid current cell border in FullRow selection mode

I am using a DataGrid in row selection mode (i.e., SelectionUnit="FullRow"). I simply want to remove the border that is being placed around the current cell when the user highlights a row in order to have true full row selection (and no cell level…
Michael Goldshteyn
  • 65,547
  • 23
  • 122
  • 176
32
votes
1 answer

How to grow/shrink a TextBlock (Font Size) to the available space in WPF?

I've seen this question asked a lot, however, to the opposite of what I'm looking for. While other people want a control to size itself based on the size of text, I'm trying to figure out is if there is a way to grow the size of text to the amount…
Greg Andora
  • 1,367
  • 2
  • 11
  • 16
29
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
  • 18,547
  • 8
  • 40
  • 59
27
votes
3 answers

0x88980406 SyncFlush() ...Is there a workaround?

I get this exception in my application. I have found links discussing it on the web but nothing indicating how to track it down and/or workaround it. Please do not reply with links from the internet. Please reply with strategies of tracking the…
cbuteau
  • 706
  • 1
  • 7
  • 13
22
votes
6 answers

Getting WPF Data Grid Context Menu Click Row

I have a WPF DataGrid
O.O.
  • 1,743
  • 6
  • 25
  • 35
18
votes
1 answer

Why is my Grid's width NaN?

I have the following mark-up in a view. When I get WindowContainer.Width during start-up code for the view, it returns NaN.
ProfK
  • 44,292
  • 106
  • 358
  • 713
17
votes
2 answers

WPF Rectangle with different stroke thickness on sides or Border with dashed stroke?

I know I can create a dashed border with a rectangle or a border with different stroke thickness for different sides:
markmnl
  • 10,001
  • 7
  • 64
  • 102
13
votes
3 answers

Why can't I style a control with the Aero theme applied in WPF 4.0?

I recently converted a project from WPF 3.5 to WPF 4.0. Functionally, everything works, but the DataGrid style I was applying on top of the Aero theme has suddenly stopped working. As you can see from the before/after pictures below, my DataGrids…
devuxer
  • 39,573
  • 46
  • 163
  • 281
13
votes
1 answer

The difference between GotFocus and GotKeyboardFocus

What is the difference(s) between GotFocus and GotKeyboardFocus -and similarly LostFocus and LostKeyboardFocus? Sorry for the simple question, but, I googled it and read a lot of blog posts, but I'm still confused. It seems nobody knows exactly…
agent47
  • 6,467
  • 15
  • 50
  • 79
13
votes
4 answers

IDataErrorInfo - Initially ignore the errors when view is first loaded

I am trying to validate my model class using IDataErrorInfo as given below. //Validators public string this[string propertyName] { get { string error = null; if (propertyName == "Name") { error = ValidateName(); …
Jatin
  • 3,863
  • 10
  • 53
  • 104
12
votes
2 answers

UI Automation events stop being received after a while monitoring an application and then restart after some time

We are using Microsoft's UIAutomation framework to develop a client that monitors events of a specific application and responds to them in different ways. We've started with the managed version of the framework, but due to delay issues, moved to the…
o_weisman
  • 764
  • 6
  • 18
10
votes
7 answers

WPF DotNET Application will run in debug mode, but .EXE will not run

I wrote a WPF application in C# using VS 2010. The application will run fine in debug mode using Visual Studio, but when I go to run the .EXE from the bin\release folder, nothing happens. I do not get any error messages from windows and there are no…
user441603
  • 457
  • 3
  • 6
  • 16
10
votes
2 answers

How to select all the text when the edit textbox in a DataGridTemplateColumn receives focus?

I'm trying to get a DataGridTemplateColumn to behave identically to a TextColumn when the cell goes into edit mode (Press F2), the user can immediately start typing in the new value by default, existing text content is selected - so that you can…
Gishu
  • 126,803
  • 45
  • 214
  • 298
9
votes
1 answer

Overriding button background in WPF on Aero

So, the desire is simple, change a button's background to LightGreen, Green when the mouse cursor hovers over it and DarkGreen when it is pressed. The following XAML is my first attempt:
Michael Goldshteyn
  • 65,547
  • 23
  • 122
  • 176
1
2 3
28 29