我在我的wpf应用程序中使用MahApps.Metro控件。 我在按钮点击时将MetroTabItem添加到MetroTab控件。 >尝试关闭MetroTabItem时出现异常。 异常消息:由于对象的当前状态,操作无效。 使用以下代码在运行时添加TabItem。
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.
MetroTabItem tbItem = new MetroTabItem(); tbItem.Header = "RunTime"; tbItem.CloseButtonEnabled = true; TextExamples cnt = new TextExamples(); tbItem.Content = cnt; MainTabctrl.Items.Add(tbItem);在公共Window()上创建的MetroTabItems(即表单加载),上面给出的代码没有显示任何问题。 请帮我解决问题。 提前谢谢..
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..
推荐答案我在这里获得了解决方案。 /> 问候 Sameer I got solution here . Regards Sameer
更多推荐
尝试关闭动态创建的MetroTabItem时出现运行时异常
发布评论