WinTabbedEditor DefaultTab Property

StatusIDPriorityType
Open29254MajorQuestion
ProfileReply
niemimikClient

Hi!

We trying to figure out behavior for WinTabbedEditor's DefaultTab setting (see screenshot). We have set on top level but it will only follow CurrentTab setting.

We like have that it open certain tab when view is activated. Or can acess tabs at runtime easily?

public void TryInitializeFirstTab()
{
PropertyEditor propertyEditor = ((DetailView)View).FindItem("ThisObject") as PropertyEditor;
if (propertyEditor != null)
{
if (propertyEditor is Xafari.Editors.Win.WinTabbedDetailPropertyEditor)
{
var prop = (Xafari.Editors.Win.WinTabbedDetailPropertyEditor)propertyEditor;

//prop.CurrentTab = This where should access for tab list....
}

}
}

Attached files:

Replies

UserDescriptionPosted On
Sasha (Xafari Support)Client

Hello,

Thanks for the provided information. We are going to investigate it. Give me some time.

Best regards,
Sasha.

Sasha (Xafari Support)Client

Hi mikko,

We have two similar properties for TabbedDetailPropertyEditor in Model, there are DefaultTab and CurrentTab.
Where
DefaultTab - Specifies the Tab that opens when you click on this Tab.
CurrentTab - Specifies the last selected tab.
At that the DefaultTab works when you open your application a first time, further the CurrentTab works and opens the last opened tab - it's logic the editor.

To change this behavior you can using ViewController.
As example:

public partial class CustomerViewController : ViewController
{
...
protected override void OnViewControlsCreated()
{
base.OnViewControlsCreated();
TryInitializeFirstTab();
}
public void TryInitializeFirstTab()
{
PropertyEditor propertyEditor = ((DetailView) View).FindItem("ThisObject") as PropertyEditor;
if (propertyEditor is Xafari.Editors.Win.WinTabbedDetailPropertyEditor)
{
var prop = (Xafari.Editors.Win.WinTabbedDetailPropertyEditor) propertyEditor;
var tabDetailProp = prop.Model as IModelTabbedDetailPropertyEditor;
if(tabDetailProp == null) return;
if (tabDetailProp.Tabs.DefaultTab != null)
prop.CurrentTab = tabDetailProp.Tabs.DefaultTab;
}
}

We hope you find this information helpful.
Feel free to contact us if you need further assistance or have additional questions.
Thanks, Sasha.

Write US