wpf

Strange issue binding to ComboBox where the display value sometimes shows up blank

I'm seeing a strange issue when binding to ComboBox where the display value sometimes shows up blank. The case is repeatable however and happens the second time a dialog opened from another parent form. If the parent form is closed and reopened then the first time it's child dialog is opened the contained WPF ComboBox shows the display p...

TabControl.Items.Remove(TabItem) does not free memory used by TabItem

I am having a WPF application where when I close a TabItem from TabControl using TabControl.Items.Remove(TabItem) does not free memory used by TabItem. It just makes TabItem invisible and TabItem object still remains in the memory. Is there any way to remove this TabItem object from memory ? Any help would be appreciated. ...

How to move a tab control dynamically on a wpf form

Hi I am trying to move a tab control on a wpf around dynamically. The tab control is hooked to a timer and basically if you press a button the size is shrunk so it looks and behaves like an expandable panel. However, when I 'shrink' the tab control the width is adjusted centrally, whereas I want the control to stay where it was positi...

How to enable NewItem Placeholder in WPF data grid

Hi, I have a wpf datagrid which is bound to an observable collection. Currently I don't have the NewItemPlaceHolder. How can I enable NewItemPlaceholder (an empty row in the bottom to add new rows)? Here is how I declared my datagrid: <WpfToolkit:DataGrid x:Name="grid" ItemsSource="{Binding Path=SampleObservableCollection}"...

WPF MVVM TreeView selected item not populating current selection object

I'm using WCF and MVVM pattern to populate a tree view control and I need the selected item passed as a parameter for another method in the view model (to populate a different control). The treeview populates just fine but the selected value is not being passed to the view model. e.g. in the viewmodel: private ICollectionView m_S...

How to get ComboBox.SelectedText in WPF

In WPF ComboBox does not have SelectedText property. Is there a way to achieve the same functionality as TextBox SelectedText has in WPF ...

Oracle 10g-Express Query

I want to perform a special query on a table in my oracle database. I want the result to be sorted according to an enum that I have. the enum goes as follows: private enum days { Saturday = 1, Sunday, Monday, Tuesday, Wednesday, Thursday, } I want the result to be sorted according to this enum. ...

Unable to use IMultiValueConverter in WPF to allow metric or imperial input

I would like to create a C# WPF form that collects measurements of equipment, but some users insit on using feet and inches for measurements while other (younger) users do everything in metric. The database stores everything in meters, and I figured this was a perfect place to use a IMultiValueConverter. Each form has a DependencyProper...

How to you create a method that is called with the main window come active in a WPF app?

How to you create a method that is called with the main window come active in a WPF app? ...

What audio format works for Silverlight + WPF ?

Hi, I'm writing a pair of applications for distributing audio (among other features). I have a WPF program that allows an artist to record and edit audio. Clicking a button then uploads this to a silverlight-powered website. A consumer visiting this website can then listen to the audio. Simple. It works. But I'd like it to be better: I ...

C# WPF Custom Message Box

Is it possible to create my own Custom MessageBox where I can be able to add images instead of only strings? ...

Handling the "X" close button in WPF under MVVM

I'm creating a basic database application in WPF, and I have started using the MVVM pattern. I have a dialog that asks the user to select an item from a ListBox and click "OK." After that, I take the item the user clicked from a property in the view model and pass it into another dialog. But if the user clicks "Cancel," I set that valu...

good sample/simple wpf project to get started..

I am looking for a good sample/simple wpf project to get started.. Any good tutorials out there.. ...

How can I change the background of a Canvas in WPF during runtime?

My scenario is the following. I am creating a little math quiz application for my son and wanted to dynamically change the background ImageBrush of my canvas after each question is answered. I proceeded to embed my images (pngs) into a resource file and figured I would load them into an array and then randomly choose one and load it into...

In WPF how do we define Duration as a resource?

Hi, I have a duration (0:0:0.5) that I use in a number of animations and I would like to define this number at one place only. I can define a double for instance as <Window.Resources> <sys:Double x:Key="GridWidth">400</sys:Double> </Window.Resources> But not sure how a duration should be expressed as a resource. Thanks. ...

Cannot seem to load datagrid wpf Can you help?

Hi, For some reasons I cannot seem to populate a datagrid I get the following error: System.Windows.Data Error: 40 : BindingExpression path error: 'Customers' property not found on 'object' ''ObservableCollection`1' (HashCode=11497055) Can you spot what I am doing wrong? The code is as follows: ViewModel ============= ...

WPF Images not rendering from in-memory sources.

I have a data class in my application which maintains a collection of byte arrays representing JPEG images. It's defined as: private ArrayList FrameList = new ArrayList(); I'm having some troubles with my Image object rendering a blank page (and taking its sweet time to do it as well). When I insert a blank image with a 2K in-memory b...

Custom TreeView move items and get updated coordinates

Hi all, I am using a Custom TreeView (whit custom item style) bound to an ObservableCollection. I have a function that walks the tree and calculates/stores items' coordinates with the purpose of drawing some custom shapes over the tree. It uses something like this: (...) FrameworkElement grid = VisualTreeHelper.GetChild(currentParent, 0...

WPF + MVVM - How to bind a property to the parent view's data context.

Working with the MVVM pattern, I have a pair of view model classes that represent a two-tier data hierarchy, each with a corresponding UserControl that represents its view. Both view model classes implement INotifyPropertyChanged and the root level view model exposes a property that is relevant to both its own view and the child view. T...

how to programatically add rows to rdlc report table in wpf(C#)

how i can add rows to wpf hosted rdlc report programmatically from c#. or is there any way to format table data column-wise as VS2010 report supports in VS2008. ...