Asked By mrumka
01-Oct-09 05:29 PM

I have component TableView which read CVS (comma separated) files and
represent them as collection of items. TableView works like DataTable to hold
arrays of data in the rows/items. TableView implement ITypedList to identify
list of properties for each item of TableView. These properties create from
list of user defined fields.
It works OK in WinForms and WPF without any problems and easy bind to the
DataGrid, ListBox and ListView in Winforms and WPF.
But it does not work properly in the Microsoft Blend 3. Actually Microsoft
Blend 3 does not want read list of items from TableView and list of
properties by using ITypedList. Microsoft Blend 3 display my TableView as an
object and not collection of items. How to solve that problem?
Screenshot of blend with commentaries -
http://img9.imageshack.us/img9/3739/msblend3.png
TableView classes
public abstract class AbstractTableView<TRecord> :
MarshalByValueComponent, ITableView,
INotifyPropertyChanged, ITableViewCallbacks, ISupportInitialize
where TRecord : AbstractRecord
{
//it is definition of columns in the CVS file and same list uses in
the ITypedList to retrieve list of properties
public FieldCollection Fields
{
get { return _fields; }
}
}
public abstract class BindableTableView<TRecord> :
AbstractTableView<TRecord>,
IListSource, IList<TRecord>, IList, ITypedList, IBindingList,
ICancelAddNew, INotifyCollectionChanged
where TRecord : AbstractRecord
{
}
public abstract class TableView<TRecord> : BindableTableView<TRecord>
where TRecord : TableViewRecord
{
}
public class TableView : TableView<TableViewRecord>
{
}
where AbstractRecord and TableViewRecord is
public class TableViewRecord : AbstractRecord
{
}
public abstract class AbstractRecord : IDataErrorInfo,
INotifyPropertyChanged, ICustomTypeDescriptor
{
}
Implementation of data provider TableViewDataProvider to work with TableView
public class TableViewDataProvider : DataSourceProvider
{
private TableView _tableView;
private DispatcherOperationCallback _onCompletedCallback;
public TableView TableView
{
get { return _tableView; }
set
{
_tableView = value;
base.OnPropertyChanged(new
PropertyChangedEventArgs("TableView"));
}
}
protected override void BeginQuery()
{
//base.BeginQuery();
Exception exception = null;
try
{
if (TableView != null && !TableView.IsOpened)
{
TableView.Open();
}
}
catch (Exception ex)
{
exception = ex;
}
base.OnQueryFinished(TableView, exception, CompletedCallback,
TableView);
}
private DispatcherOperationCallback CompletedCallback
{