Click here to Skip to main content
15,885,141 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am using MahApps.Metro controls in my wpf app.
I am adding MetroTabItem to MetroTab control on button click.
> getting exception while trying to close MetroTabItem .

Exception Msg: Operation is not valid due to the current state of the object.

using the following code to add TabItem at runtime.

C#
MetroTabItem tbItem = new MetroTabItem();
tbItem.Header = "RunTime";
tbItem.CloseButtonEnabled = true;
TextExamples cnt = new TextExamples();
tbItem.Content = cnt;
MainTabctrl.Items.Add(tbItem);


The MetroTabItems created on public Window() (i.e form loading), not showing any problem with the same code given above.

please help me to solve the issue.
Thanks in advance..
Posted
Updated 21-Oct-14 7:19am
v2
Comments
Sergey Alexandrovich Kryukov 21-Oct-14 13:26pm    
What would it possibly mean, "close an item"? :-)
—SA

1 solution

I got solution here .

Regards
Sameer
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900