| BcfHierarchicalViewManagerAddRootBindingSourceTBindingSource Method |
[This is preliminary documentation and is subject to change.]
Creates and registers a new binding source.
Namespace:
CalculationWorks.ViewModel.Forms
Assembly:
CalculationWorks.ViewModel.Forms (in CalculationWorks.ViewModel.Forms.dll) Version: 4.0.0-beta7
Syntax protected TBindingSource AddRootBindingSource<TBindingSource>(
string name,
BcfTable table,
Func<BcfBindingSourceBuilder, TBindingSource> createBindingSource
)
where TBindingSource : BcfBindingSource
Protected Function AddRootBindingSource(Of TBindingSource As BcfBindingSource) (
name As String,
table As BcfTable,
createBindingSource As Func(Of BcfBindingSourceBuilder, TBindingSource)
) As TBindingSource
Parameters
- name
- Type: SystemString
The name. - table
- Type: CalculationWorks.BusinessModelBcfTable
The table. - createBindingSource
- Type: SystemFuncBcfBindingSourceBuilder, TBindingSource
TBindingSource constructor.
Type Parameters
- TBindingSource
- The type of the binding source.
Return Value
Type:
TBindingSourceTBindingSource.
Exceptions Remarks Examples [ToolboxItem(true)]
public partial class MyViewManager
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public BcfBindingSource MasterBindingSource { get; set; }
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public BcfBindingSource DetailBindingSource { get; set; }
public override void InitializeBindingSources()
{
MasterBindingSource = AddRootBindingSource("Master", DataSet.MasterTable, (b) => new BcfBindingSource(b));
DetailBindingSource = AddBranchBindingSource("Detail", MasterBindingSource, DataSet.MasterToDetailRelation, b => new BcfBindingSource(b));
}
}
See Also