wpf

WPF out of memory exception when loading large amount of bitmaps in single instance of app. Is there a limit?

I need to load large amounts of bitmaps into memory for display in a WPF app (using .net 4.0). Where I run into trouble is when I approach around 1,400MB of memory ( I am getting this from the process list in the task manager). This same thing happens whether the app is run on a machine with 4GB of memory or 6GB (and some other configs...

How to get rid of the untouchable yellow border of the ribbon menu-button?

I'm new to WPF control template and need your help on this. I got a sample Microsoft Ribbon project here. I tried to change the color of the ribbon menu button but I can not make the yellow border goes off. Please see screenshot below. If you have a work-around, please help! You can get MS Ribbon from: http://www.microsoft.com/dow...

Setting platform target to x86 on my x64 laptop prevent some WPF types to load properly

I have a x64 machine running Windows 7 64 bits. It seems I have a very weird situation since the beginning of the week. If I build and run a WPF application with platform target set as x86, I got a MissingMethodException when trying to create a Grid: var g = new Grid(); However, creating a StackPanel works fine: var s = new StackPan...

custom button control WPF

Hi, i want to make a custom button using wpf. The button will be used to control a mediaplayer. the type(play, stop, pause,...) of the button is specified using an enum namespace vgtunesWPF { public class MediaButton : Button { [Browsable(true)] public Button_Type ButtonType { get { return (Button_Type)GetValue(Butto...

XCeed and the DataGridVirtualizingQueryableCollectionView

With a large set of tables in a SQL database, I've implemented the DataGridVirtualizingCollectionView to 'lazy load' where needed into the WPF front end using XCeeds DataGrid for WPF. This works quite well, but I notice that this class doesn't implement any kind of filtering mechanism. Looking at the documentation here it appears that t...

Dynamically binding to property of child controls

Would it be possible to bind to Validation.HasErrors on any child control of a panel, without explicitly binding to every named control? Specifically i want to fire a trigger on a general style of a panel if any child control is in error state. Thanks. ...

How to call Winforms-style Invoke/Delegate from MVVM?

Hi, I'm hacking away at some code which seems to have been started, at least in theory, as an MVVM project in Expression Blend, by my predecessor at this company. I've got a thread running in the background, which is running some operations on items as they happen. In order to prevent any clashes, I've also got that thread running any ...

How to unit test GUI elements?

I would like to create a custom user control, which extends the textbox in WPF, but only accepts numeric values. When the user types in a non numerical value, the textbox should not respond to the input. How can I simulate userinput to a textbox, to be able to create a unit test for this behaviour? I am using the built in test framewor...

How can I capture CTRL-BACKSPACE in WPF/C#?

I have an application which uses PreviewKeyDown to capture CTRLX keystrokes (where X is any letter) along the lines of: Key key = (e.Key == Key.System ? e.SystemKey : e.Key); if (e.KeyboardDevice.Modifiers == ModifierKeys.Control) { switch (key) { case Key.A: keyStroke = 0x01; break; case Key.B: keyStroke = 0x02; bre...

LINQ to SQL Classes with INotifyPropertyChanged and IDataErrorInfo for WPF bindings

I use the LINQ to SQL Classes to access to my database. Now I want to use the LINQ to SQL Classes for WPF DataBindings and validation. How do I implement these two interfaces to my projects Model? Is it possible implement INotifyProperty automatically? ...

Using binding for the Value property of DataTrigger condition

hi , I have the same problem that already been asked here: http://stackoverflow.com/questions/2240421/using-binding-for-the-value-property-of-datatrigger-condition it been answered but I don't understand the solution, can someone explain it to me? ...

WPF ValidationRule not firing when value is null.

I'm having a problem with validation rules not firing when the initial value that they are bound to is null. For example I have this DataGridTextColumn that is in a DataGrid that has CanUserAddRows set to true. <DataGridTextColumn Header="Supplier Ref" Width="*"> <DataGridTextColumn.Binding> <Binding Path="SupplierRef" Mode="TwoWay...

Get selected row item in DataGrid WPF

Hi, I have a DataGrid, binded to Database table, I need to get content of selected row in DataGrid, for example, I want to show in MessageBox content of selected row. Example of DataGrid: ID Name Domain 464 Alex Math 646 Jim Biology So if I select second row, my MessageBox has to show something like: «646 Jim Biology». Thanks. ...

Load a project resource into a WPF Webbrowser control

OK, so I thought this would be really simple even though I have only just got by previously when working with WPF project resource files. When my application starts I want to load in a local (shipped with the application) html file into the Webbrowser control. However I cannot find an easy way to do this! Any ideas? ...

Must scenario for events related to Multithreading in C#?

I am wondering that in which scenario we must use events technique in multithreading and there is no other way around? I have seen cases we may use another syncronization techniques like Monitor wait and pulse to implement this. Can anyone help me out to understand events in Multithreading ? ...

WPF - Binding large amount of data in Listbox

Hi All, I am creating a search page for books. There are lacks of data in the database. If the data size is more than 2000 the application is getting hanged. ItemsSource of the listbox having the data but something wrong is happening behind. Code <ListBox Grid.Column="1" x:Name="lbResult" ItemsSource="{Binding}" SelectionChanged="lb...

How to get the caller of a WPF Converter?

Hi, I try to get the element which calls a converter in it's Convert function. The reason is, that I've got a style for TreeViewItems, and want to Bind the BackgroundColor to the Content(If there are subitems or not). Therefore I need the Converter, who needs to know what the correspondenting Item contains, and in my opinion therefore...

Making WPF application multiprocess

I currently have a multithreaded application which runs in following order: Start up and change XML file Do work Change XML to default values The step 3 is very important and I have to insure that it always happens. But if the application crashes, I might end up with the wrong XML. The scenario where I am using it is: My applicati...

WPF button with image of a circle

I have a coloured circle in a .png, the rest is transparent. I am able to place that image on a button but the rest of the button's style is visible on the transparent are of the image. How can I hide it, in normal, mouse over and pressed mode? ...

Is there a way to show a splash screen for WPF application?

Dupe: http://stackoverflow.com/questions/3677653/wpf-animated-splash-screen I would like to show a splash screen for my WPF application. what I want to do is to show it while I load dictionary from a file (it takes about 5-6 seconds to load). Is there a way to achieve this in WPF? I would appreciate some tutorial, since this is a littl...