请版主帮帮忙,这个问题怎么解决,
MVVM模式下,ViewModel里的部分代码如下:
GridView tempView = this.View.mainBox.Resources["tempGridView"] as GridView;
foreach (RoomClassify item in RoomClassifyList)
{
ListView listView = new ListView();
listView.View = tempView;
TabItem tab = new TabItem();
tab.Content = listView;
tab.Tag = item;
tab.Header = item.RoomClassifyName;
this.View.RoomListTab.Items.Add(tab);
}
View里定义了一个MainBox的Grid,里面有一资源tempGridView,资源指定了:x:Shared="False",但是报错:View can't shared by more than one listView
如何复制资源?