From c37dc3013323a25ce2107080cbfb50c48d936652 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 3 Mar 2026 13:52:03 +0000 Subject: [PATCH] Fix CS0136 compilation error: rename inner targetLayer to stateLayer to avoid scope conflict Co-authored-by: LoogLong <86428208+LoogLong@users.noreply.github.com> --- FModel/Views/AnimGraphViewer.xaml.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/FModel/Views/AnimGraphViewer.xaml.cs b/FModel/Views/AnimGraphViewer.xaml.cs index 5bbc8fa0..0cc4f840 100644 --- a/FModel/Views/AnimGraphViewer.xaml.cs +++ b/FModel/Views/AnimGraphViewer.xaml.cs @@ -568,20 +568,20 @@ public partial class AnimGraphViewer if (node.AdditionalProperties.TryGetValue("StateRootNodeName", out var rootNodeName) && !string.IsNullOrEmpty(rootNodeName)) { - var targetLayer = _viewModel.Layers.FirstOrDefault(l => + var stateLayer = _viewModel.Layers.FirstOrDefault(l => l.Nodes.Any(n => n.Name == rootNodeName)); - if (targetLayer != null) + if (stateLayer != null) { // If tab already exists, just select it foreach (System.Windows.Controls.TabItem tab in LayerTabControl.Items) { - if (tab.Tag == targetLayer) + if (tab.Tag == stateLayer) { LayerTabControl.SelectedItem = tab; return; } } - AddLayerTab(targetLayer); + AddLayerTab(stateLayer); return; } }