wpf

WPF: Is it standard that when a menuitem is disabled the icon is not greyed out?

I have menuitems with icons and when it is disabled the icon remains the same. Is it up to me to supply a disabled icon and, if so, does this also apply to menuitems bound to a command? ...

WPF: RichTextBox typing TWICE slower than in a VB 5.0 RichTextBox ...

Hello, first this is no rant although its worth alone to put it on a blog... When I type very fast - having roughly 260 chars/minute - WPF`s RichTextBox starts swallowing chars and I have to stop writing that fast a => a.IsAnnoying = true; The same in a VB 5.0 RichTextBox fast as hell. Why is WPF again so great for? Customer satisfac...

Invert WPF GridView to bind items to columns instead of rows

Is there a simple way to invert a WPF GridView so that items are bound to columns instead of rows? Or would it be necessary to write a custom view mode? ...

Windows gadget in WPF - show while "Show desktop" is activated

Hi I'm trying to create a "gadget" like application using WPF. The goal is to get the same behavior as a normal Windows 7 gadget: No task-bar entry Doesn't show up when you alt+tab windows NOT always on top, applications can be on top Visible while performing 'Aero Peek' Visible while using 'Show desktop' / Windows+D I've been able ...

Putting WPF Control (ComboBox) into canvas with Visuals

I am writing a WPF chart and use Visuals for performance. The code looks like: public class DrawingCanvas2 : Canvas { private List<Visual> _visuals = new List<Visual>(); protected override Visual GetVisualChild( int index ) { return _visuals[index]; } protected override int VisualChildrenCount { get { return _visuals.Count;...

WPF derived ComboBox SelectedValuePath issue

In our application we have a very large set of data that acts as our data dictionary for ComboBox lists, etc. This data is staticly cached and keyed off of 2 variables, so I thought it wise to write a control that derived from ComboBox and exposed the 2 keys as DPs. When those 2 keys have proper values I set the ItemsSource of the Comb...

Setting toolbar button sizes using a Style

I have buttons on a toolbar in WPF. When I do the XAML: <ToolBar.Resources> <Style TargetType="{x:Type Button}"> <Setter Property="Width" Value="21"></Setter> <Setter Property="Height" Value="21"></Setter> </Style> </ToolBar.Resources> None of the buttons on the toolbar set their sizes accordingly. I have to go to ...

How to programatically create a xaml panel with controls

Hello, Is it possible to programatically create a new panel within a current document that contains duplicate elements? For example when the window loads I have a grid (one row) with three text fields, Fname01, Lname01, and DOB01, I would like to have a button that when clicked would append a new row to the grid with three new fields (F...

Open new UserControl in the mainWindows

Hi I have this snippet public partial class Window1 : Window { public Window1() { InitializeComponent(); } private void ToggleButton_Checked(object sender, RoutedEventArgs e) { switch ((sender as Button).Content.ToString()) { case "UserControl 1": AddItemToContaine...

"Overflow or underflow in the arithmetic operation" WPF specific issue

Hi, My WPF test app (very simple, just one window) is using a 3rd party managed dll (say X.dll). This managed dll uses some unmanaged dll's . So lets say I write a small wpf app which just references X.dll. And in the window's constructor I access something inside X.dll (ie. in some namespace in X.dll). On doing this i dont catch any ex...

Binding a CollectionViewSource in a ControlTemplate

I am trying to create a ControlTemplate which will merge 2 IQueryables (and some other things) into a CompositeCollection. I am having issues getting the CollectionViewSource.Source to bind correctly to the template. It looks like TemplateBinding in the Resources section is not supported. What is the best way to get around this limitati...

WPF Composite - Expose EF model to all modules

Hi All, I have an application that uses WPF Composite, and I have an issue. I've got a big database that is attached to the application and I need it exposed to different modules as part of the application. What is the best way to expose my Entity Framework model to all my different modules and views inside them? Do I have one EF mode...

What is the difference between DataTemplate and DataContext in WPF?

I can set the relationship between View Model and view through following DataContext syntax: <UserControl.DataContext> <view_model:MainMenuModel /> </UserControl.DataContext> And I can also set the relationship between View Model and view through following DataTemplate syntax: <DataTemplate DataType="{x:Type viewMode...

How to add children of an ItemsControl where the children should decide their own position in Wpf?

Hey all I am using a wpf slider to display the time line in a video player. I need to add an ItemControl of some sort on top of this so that I can add buttons on the time line on certain positions in the time line (the buttons will hold their own position relative to the parent ItemsControl). What ItemsControl container should I use wh...

How to apply WS_EX_TRANSPARENT in WPF?

I want to make a splash screen, which cannot be clicked/selected by mouse/UI. As such how to I apply Win32.ExtendedWindowStyles.WS_EX_TRANSPARENT on Windows Presentation Foundation Window? In Forms I'd do this. ...

Passing a value from a WPF page to its parent's window

Hi, I am hoping for some guidence. I have a wpf application that contains a window (Window1) and a page (Page1). The page is inside the window using a frame. I have a button within the page that I want to be able to press and pass a string value back to mainwindow and display it within a label. Can anyone help with a basic example as I...

WPF Image become black at specific height value

I've a Image control inside a ScrollViewer and TIFF file set as its source. Image displayed with black overlay for some height values (in range of 40% to 60% of image's actual height). I find it only when Stretch value is set to anything other than "None". <ScrollViewer Grid.Column="2" Margin="5" HorizontalScrollBarVisibility="Visible" ...

problem loading resource from class library

I have a class library (mylibrary) which has a resource called "close.png". I used redGate reflector to confirm that the resource is actually present in the dll. Now i use mylibrary.dll in a project where i attempt to extract this "close.png" resource like this : BitmapImage crossImage = new BitmapImage(); crossImage.BeginInit(); c...

WPF: Binding Hierarchy

I have defined a default binding in my style. For example I have configured the visibility binding of my button so that it must not be visible if the relative command can not execute. This is my default binding behavior. Apart from my default behavior, every view can customize the buttons it uses with another visibility binding. I w...

How can my controls size be NaN when it is actually shown?

I have a Grid which contains an Image in one of its columns. The image itself does not have any Width or Height set, but its size is correctly controlled through the ColumnDefinition set. From this I would assume that the image controller actually has a Width and Height set, but when I try to bind another element to its Width and Height ...