This question is locked. New answers and comments are not allowed.
I'm trying bind Following type of object collection to rad tab but i get
In Tab Handler
In View
When i run it what i can see is assembly name of TabViewCollection both in tab header and tab content.
Please help
Thanks
public ObservableCollection<
INavigatableTab
> TabViewCollection
{
get
{
if(_tabViewCollection == null)
ProcessTabViews();
return _tabViewCollection;
}
}
public void ProcessTabViews()
{
var infoKey = new InfoKey()
{
AgencyID = ApplicationGlobal.Settings.AgencyInfo.AgencyID,
EndorsementID = ApplicationGlobal.ActiveEndorsement.EndorsementID,
PolicyNumber = ApplicationGlobal.ActiveEndorsement.PolicyNumber
};
_tabViewCollection = new ObservableCollection<
INavigatableTab
>()
{new BasicInfoViewNavigatableHandler(infoKey, new EndorsementGeneralDataService())};
}
In Tab Handler
public class BasicInfoViewNavigatableHandler : INavigatableTab
{
#region Fields
private readonly InfoKey _infoKey;
private BasicInfoView _view;
private BasicInfoViewModel _basicInfoVM;
private readonly IEndorsementGeneralDataService _endorsementGeneralDataService;
#endregion
#region Constructors
public BasicInfoViewNavigatableHandler(InfoKey infoKey, IEndorsementGeneralDataService endorsementGeneralDataService)
{
_infoKey = infoKey;
_endorsementGeneralDataService = endorsementGeneralDataService;
}
#endregion
#region Properties
BasicInfoViewModel BasicInfoVM
{
get { return _basicInfoVM ?? (_basicInfoVM = new BasicInfoViewModel(_infoKey, _endorsementGeneralDataService)); }
}
#endregion
#region Events
#endregion
#region Methods
#endregion
#region Commands
#endregion
#region INavigatableTab Members
public string TabName
{
get { return "Address"; }
}
public UserControl View
{
get { return _view ?? (_view = new BasicInfoView() {DataContext = BasicInfoVM}); }
}
public Type NextViewType
{
get { return typeof (BasicInfoView); }
}
public Type PreviousViewType
{
get { return null; }
}
public int TabIndex
{
get { return 0; }
}
public int StepIndex
{
get { return 0; }
}
public bool CanProcess(Type viewType)
{
return viewType == _view.GetType();
}
public bool CanProcess(int stepIndex)
{
return stepIndex == StepIndex;
}
#endregion
#region IJumpableTab Members
public event EventHandler<
CustomEventArgs.JumpableTabEventArgs
> OnJumpTo;
#endregion
}
In View
<
telerik:RadTabControl
x:Name
=
"cntrltab"
MinWidth
=
"700"
telerik:StyleManager.Theme
=
"Windows7"
HorizontalContentAlignment
=
"Left"
SelectedIndex
=
"{Binding CurrentTabIndex, Mode=TwoWay,FallbackValue=0}"
BorderThickness
=
"0,1,0,0"
Margin
=
"0,10,0,0"
d:LayoutOverrides
=
"HorizontalAlignment, Width, Height"
Grid.Row
=
"1"
Background
=
"{x:Null}"
ItemsSource
=
"{Binding TabViewCollection, Mode=TwoWay}"
>
<
telerik:RadTabControl.ItemContainerStyle
>
<
Style
TargetType
=
"telerik:RadTabItem"
>
<
Setter
Property
=
"HeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
TextBlock
Text
=
"{Binding TabName}"
FontSize
=
"11"
Margin
=
"5 0 5 0"
VerticalAlignment
=
"Center"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"ContentTemplate"
Value
=
"{Binding View}"
/>
</
Style
>
</
telerik:RadTabControl.ItemContainerStyle
>
</
telerik:RadTabControl
>
When i run it what i can see is assembly name of TabViewCollection both in tab header and tab content.
Please help
Thanks