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
423 questions
260
votes
5 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
  • 20,500
  • 38
  • 146
  • 211
65
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
  • 71,784
  • 24
  • 131
  • 181
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,372
  • 2
  • 11
  • 17
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
28
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
  • 736
  • 1
  • 7
  • 15
24
votes
6 answers

Getting WPF Data Grid Context Menu Click Row

I have a WPF DataGrid
O.O.
  • 1,973
  • 6
  • 28
  • 40
19
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
  • 49,207
  • 121
  • 399
  • 775
18
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
  • 11,116
  • 8
  • 73
  • 109
14
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…
amiry jd
  • 27,021
  • 30
  • 116
  • 215
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
  • 41,681
  • 47
  • 180
  • 292
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
  • 4,023
  • 10
  • 60
  • 107
12
votes
2 answers

Create a simple wpf trigger on one object that affects another

This is the closest that I have come to creating a simple trigger on this. I just want the datagrid's IsMouseOver == true to show the button. The problem is that the Setter's TargetName says: The property 'TargetName' does not represent a valid…
Bluebaron
  • 2,289
  • 2
  • 27
  • 37
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
  • 804
  • 7
  • 19
12
votes
1 answer

[WPF]How to draw a grid on canvas?

How to draw the following chart as a background on custom canvas inherited from Canvas - system ui element? Thanks for any useful links.
ske
  • 4,694
  • 3
  • 23
  • 35
11
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
  • 487
  • 3
  • 6
  • 16
1
2 3
28 29