0
votes

I'm using DevExpress controls. I have a DocumentLayoutManager in that I have DocumentGroup. For Example:

<dxdo:DocumentLayoutManager>
<dxdo:DocumentGroup x:Name="dcGroup"/>
</dxdo:DocumentLayoutManager>

Also I have Buttons. For Example:

<Button x:Name="btn1" Command{Binding btn1Click}/>
<Button x:Name="btn2" Command{Binding btn2Click}/>

I'm loading Tabs in DocumentGroup from ViewModel on respective button click(Ex: btn1click = TabItem1 & btn2click = TabItem2). Now if user clicks btn1 & btn2 then both Tabs get open, now my question is if user closes any of the tabItem which is already open and then clicks on the button again then i need to show that tab in DocumentGroup again.

1
Can you post some code for how you are opening the Tabs in the first place? - Krishna
Why can't you just open it the way you did the first time? If there is a reason why you can't do that, then fix that reason, because this is what you should be aiming for. - Sheridan
Thanks for your suggestion @Sheridan i got the solution. - user3336672
Ok good. Thanks for updating... I'll add an answer, so that this question can be set as answered, as is customary on this website. - Sheridan
@user3336672 can you post the code of yout viewmodel? - Piero Alberto

1 Answers

0
votes

Generally when programming, we try to make repeatable functions. You said:

Now if user clicks btn1 & btn2 then both Tabs get open, now my question is if user closes any of the tabItem which is already open and then clicks on the button again then i need to show that tab in DocumentGroup again

Your function that opens the TabItems should also be repeatable. I'm guessing that you have some sort of method that you called to get and/or set the data, and generally add the TabItem. If the user closes a TabItem and then wants to reopen it, you should aim to call the same method again. If there is a particular problem or reason why you can't do that, then fix that problem, because this scenario is what you should be aiming for.