ファイルを個別に作成し、ResourceDictionaryファイルから呼び出していApp.xamlます。
では、Windowラム タイムのツリー ビューを作成しています。ユーザーが実行時に子を追加できるようにしています。
if (strParName == "-1")
{
treeViewLocation.Items.Clear();
_nLastAddedNodeID = 0;
_rootTreeViewItem = newNode;
strctLocationNode.ParentTreeNode = null;
treeViewLocation.Items.Add(newNode);
}
else
{
if (localTreeNodeCollection.ContainsKey(strParName))
{
parentLocNode = localTreeNodeCollection[strParName];
parentLocNode.CurrentTreeNode.Focus();
parentLocNode.CurrentTreeNode.Items.Add(newNode);
}
}
を適用しない場合はStyle、正常に動作します。しかしStyle、コードを適用すると、次の場所でクラッシュします。
parentLocNode.CurrentTreeNode.Focus();
どうすればいいですか?