observablecollection

[C#/WPF] Combo box Item source = ObservableCollection & I need a '-None-' dummy entry at the top

I have a combo box using an observable collection as a datasource and I want a "dummy" value of "None" as the first item in the box as it controls filters against other data sources. Other databound objects also use the same observable collection so adding a "None" value directly to the datasource is not possible as I dont want, for exa...

Deserialize an observablecollection to this reference

Seems like there should be an easy one-liner here: Within my ObservableCollection derived class I binary serialize it to disk: binFormatter.Serialize(stream, this); How do I deserialize to my this object reference: This does not work: this = binFormatter.Deserialize(stream) as MyAwesomeData; Do I need to Clear the collection and add....

Will WCF allow me to use object references across boundaries on objects that implement INotifyPropertyChanged or contain observablecollection objects?

So I've created a series of objects that interact with a piece of hardware over a serial port. There is a thread running monitoring the serial port, and if the state of the hardware changes it updates properties in my objects. I'm using observable collections, and INotifyPropertyChanged. I've built a UI in WPF and it works great, show...

WPF: Xaml, create an observable collection<object> in xaml in .NET 4.0

the web site says you can in .NET 4.0 I cant seem to do it though, what assesmbly references and xmlns' do i need the following does not work xmlns:coll="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib" <coll:ObservableCollection x:TypeArguments="x:Object"> <MenuItem Command="ApplicationCommands.Cut"/> <MenuIte...

What is a good pattern for binding a collection of objects coming from WCF, in Silverlight?

Hi there, I've got a question about a Silverlight WCF Databinding pattern: There are many examples about how to bind data using {Binding} expressions in XAML, how to make async calls to a WCF service, set the DataContext property of a element in the UI, how to use ObservableCollections and INotifyPropertyChanged, INotifyCollectionChang...

wpf binding by selected value - swap out bound object without disturbing binding

Hi, I've got combo box bound to a custom collection type - its basically an overridden ObservableCollection which I've added a facility to update the underlying collection (via Unity). I don't want to confuse the issue too much, but thats the background. My xaml looks like this <ComboBox ItemsSource="{Binding Manufacturers}" DisplayM...

BeginInvoke on ObservableCollection not immediate.

In my code I subscribe to an event that happens on a different thread. Every time this event happens, I receive an string that is posted to the observable collection: Dispatcher currentDispatcher = Dispatcher.CurrentDispatcher; var SerialLog = new ObservableCollection<string>(); private void hitStation_RawCommandSent(object...

PropertyChanged Event of ViewModel in ObservableCollection

Hi All, I have a observable collection of viewmodel objects. How can I subscribe to the Property Changed event of each view model in my collection as they are created and track which ones have been changed, so that I can updated them to my database. ...

Using ObservableCollection in ASP.NET

I need to use functionality that ObservableCollection provides, in my asp.net app. My only concern is that this class is a part of WindowsBase assembly and I'm not sure if it's a good idea to include a windows assembly in a web project. Any ideas/comments? Thanks! ...

Binding to an observableCollection<string> listview

Hi, If i have a ListView (called "MainList") and want to bind to elements in a collection, how is this done. Main.Items.Add(new ObserableCollection() { "hello", "world" } then Why doesnt this work? Ive tried loads of other combinations of bindings as well.... Thanks U. ...

Binding TabControl ItemsSource to an ObservableCollection of ViewModels causes content to refresh on focus

I'm creating an WPF application using the MVVM framework, and I've adopted several features from Josh Smith's article on MVVM here... Most importantly, I'm binding a TabControl to an ObservableCollection of ViewModels. This means that am using a tabbed MDI interface that displays a UserControl as the content of a TabItem. The issue I...

WPF - Binding an ObservableCollection Dependency Property within a UserControl

I have a control class DragGrid : Grid { ... } which inherits from the original grid and enables dragging and resizing its child elements. I need to bind a custom DP named WorkItemsProperty to an observable collection of type WorkItem (implements INotifyPropertyChanged). Each element in the grid is bound to a collection item....

ObservableCollection Implementation

I know I am missing something obvious but I can't seem to implement ObservableCollection in my class below. IE it won't show up in intellsense. Can someone please let me know what I am missing. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Collections; using System.Collections.Object...

How to listen changes in Observable collection in WPF?

I have user control in which I have placed a Listview and Richtext box control. ListView is binded to my custom collection. Below the listview I placed a richtext box in which I want to display my custom text. The custom text is created from the custom collection. I want to recreate the custom text whenever any thing change in my cus...

When will the ValueConverter's Convert method be called in wpf

I have an ObservableCollection bound to a list box and a boolean property bound to a button. I then defined two converters, one that operates on the collection and the other operates on the boolean property. Whenever I modify the boolean property, the converter's Convert method is called, where as the same is not called if I modify the o...

WPF PropertyGrid - adding support for collections

Hi, I am working on wpf propertygrid(PG) control and I want the PG to support collection type(IList, ObservableCollection etc.) properties. I am bit confused on how to keep track of selected item(of that collection) and pass that to client. Any ideas? If the solution makes use of the Open Source WPF PropertyGrid (http://www.codeplex.c...

Silverlight 4 Multithread

I'm trying to update my Silverlight 4 UI approx every 1/2 second with new data. I've hooked into a WCF service using net.tcp binding and issuing callbacks from the server. To make sure I get the data from the service as quickly as possible I've started up my proxy on a backround worker inside of my Silverlight App. My question is, how...

How do I update ItemTemplate after scrambling ObservableCollection(Of ObservableCollection(Of object))

I am learning vb.net, wpf and xaml with the help of sites like this one. The project I am currently working on is a 4 x 4 slide puzzle. I cannot get the buttons in the grid to scramble to start a new game when calling a new game event. Any help will be greatly appreciated. If no answer is can be provide, a good resource to research woul...

WPF List of ViewModels bound to list of Model objects.

In the model, I have: public ObservableCollection<Item> Items { get; private set; } In the ViewModel, I have a corresponding list of ItemViewModels. I would like this list to be two-way bound to the model's list: public ObservableCollection<ItemViewModel> ItemViewModels ... In the XAML, I will bind (in this case a TreeView) to the...

observableCollection to EntitySet

How do I assign a observableCollection<T> into a EntitySet<T> ? ...