wpf

WPF text rendering inconsistencies.

WPF 4.0 notoriously fixed the blurry text issue. Setting TextOptions.TextFormattingMode="Display" uses pixel hints to line up characters, which works really well to improve clarity. However, it does not work while the program is running as a Windows service in session 0; the text goes back to "Ideal" rendering, which at small sizes is c...

How to enable scrollbar / scrolling on a WPF Datagrid

I've got a DataGrid control that's within a Grid layout container, and I can't seem to get the auto-scroll on the datagrid itself to work. I can wrap the datagrid around a ScrollViewer and thus adding the scroll bar, but the auto scrolling doesn't work. So right now when new entries are added to the datagrid, the datagrid just expands ve...

WPF ToolTip containing buttons can not recieve Mouse events, alternative ?

I want a formatbar like in Office 2010 with WPF: Select Text and then click buttons on appearing tooltip to execute a command How can I make that work? ...

Converting between WPF font size and "standard" font size

I've noticed in WPF, the default font size of 12 points is roughly equivalent to 9 points in "normal" applications (e.g. WordPad), 10 pt in WPF is roughly 7 pt standard, and when I try to match the default font size of 10 pt in WordPad in WPF, I've found 13 is the closest. First of all, why does WPF use such bizarre non-standard font si...

Using PasswordBox with WPF - MVVM

I've read several articles about how to use Attached Properties to bind to the value of a PasswordBox in WPF. However, every article also references the .NET documentation which explains why the PasswordBox was not made bindable in the first place. I do not consider myself a security expert by any means, but I figure that someone at Mi...

Handled RoutedEvent continues to bubble up tree

Hello: I'm developing a TreeView based control and my double click event continues to bubble up my TreeViewItem nodes. The goal is to have the TreeViewItem expand or collapse when it is double clicked. I have a style that applies an event handler for the MouseDoubleClick event to each TreeViewItem. Here's the code that handles the e...

Why does XamlReader throw when I use a ParserContext?

This works: XamlReader.Parse("<Pig xmlns=\"clr-namespace:Farm;assembly=Farm\"/>"); This throws The tag 'Pig' does not exist in XML namespace 'clr-namespace:Farm;assembly=Farm': var context = new ParserContext(); context.XmlnsDictionary.Add("", "clr-namespace:Farm;assembly=Farm"); XamlReader.Parse("<Pig/>", context); Why? Farm is t...

Change true/false to a image

i have a column in a datagrid that the content is True/false, how can i change this true/false(boolean) to a image, according to the text? I'm using c# wpf. Edit: <dg:DataGridTemplateColumn MinWidth="70" Header=" Is Done2"> <dg:DataGridTemplateColumn.CellTemplate> <DataTemplate> <Image Name="imgIsDone" Source=...

Adorners bleeding through

I have an expander defined as such; <Canvas Panel.ZIndex="99"> <Expander HorizontalAlignment="Left" VerticalAlignment="Top"> <StackPanel Background="White"> <TextBlock>Some Stuff in the Expander</TextBlock> </StackPanel> </Expander> </Canvas> This allows for the expander to draw over other content. The problem I'm having i...

WPF's RichTextBox performance issues

WPF's RTB is terribly slow when working with any realistic amount of text. And by realistic amount, I mean what you'd expect any text editor to be able to handle (100kb? At least) without showing any signs of slowness. This expected RTB behavior is not the case for me. Actually, the control works pretty much like it should when text is ...

Inconsistent anti-aliasing in WPF 3.5

I am getting strange aliasing behaviour in a WPF app using FluidKit's ElementFlow control. We are using the control in an app at work for presenting content, and when the elements of the ElementFlow are tilted, the edges alias as per the following image: In order to avoid the aliasing, we decided to get rid of the tilt angle, so I crea...

WPF Binding to Child Collection

Hello, if the parent's datasource has a child property that is a collection (let's say it is called ChildCollection) is there a trick to reference it? So, this code sample is basically what I am attempting to do. But when I use this approach I do not get any data to my child controls. <UserControl> <UserControl.Resources> ...

Controling popup open and close focus

Hi I have a popup which contains multiple elements, a list view, a text box and a button. These are operating fine, and if you use the button to close the popup it works as well, but when i tried to make the popup close when it lost focus, it closed when i clicked an element in the listview. Is there any way around this? Is the FocusMana...

WPF VirtualizingStackPanel support horizontal orientation?

Hi all I'm hoping to find out if UI Virtualization is supported if I set the VirtualizingStackPanel's orientation to Horizontal? I know it works automatically for a ListBox, if I set the ScrollViewer.CanContentScroll="True", and VirtualizingStackPanel.IsVirtualizing="True" and items are scrolled vertically.... Thanks. ...

Where i can find Datagrid Styles free WPF?

where i can get free datagrid style for WPF? ...

WPF ComboBox SelectedItem Set to Null on TabControl Switch

Hello everyone - I've got a simple problem in my WPF application which has me banging my head on the table. I have a TabControl, where every TabItem is a View generated for a ViewModel using a DataTemplate similar to this: <DataTemplate DataType="{x:Type vm:FooViewModel}"> <vw:FooView/> </DataTemplate> FooView contains a ComboBox:...

WPF Custom Control

I have a view with some controls and a viewbox. At the moment in the viewbox is a grid and a graphic at the bottom. The application reads a XML-file and refreshs the content of the grid and the graphic for every node in the XML-file. Now the application not only have to show a grid with a graphic. Depending on the XML-node, the applicat...

enabling disabling buton on checkbox check/uncheck wpf mvvm

Hi, I have list of checkboxes on a window specifying some items to be ordered. I neeed to first disable the Order button when the windows loads and enable it after selecting/check some items(checkboxes) and vice versa. I have bind the IsChecked property of the checkbox. Kindly Suggest. Thanks. Edit Import from OP comment:- I have o...

WPF Trigger command

Hi, I know in Silverlight there is a concept of behaviours. In WPF we have Triggers, What I am trying to achieve is that when a user has his mouse over a button, I want a command to be fired. I have a RepeatButton that has its Command Property set, but I want that command (or preferable another command to fire) when the mouse is ove...

How to use Windows Biometric Framework (WBF) in WPF application?

Hello, I'm working on WPF application which should identify user using Fingerprint Reader. It seems Windows Biometric Framework (WBF) is good enough for this task but I can't found examples where I can see how it can be used in my WPF application. Couple found examples use WBF to verify user currently logged in. But my application shou...