WPF - FindName Returns null when it should not

后端 未结 8 759
-上瘾入骨i
-上瘾入骨i 2020-12-09 07:48

FindName is broken for me :(

The object I am looking for is there. I have proof.

Here is the scenario:

ToggleButton button = (ToggleButton)s         


        
8条回答
  •  生来不讨喜
    2020-12-09 08:14

    ellipseStoryboard.Children.Add(myRectAnimation); containerCanvas.Children.Add(myPath); After you add register the controls like RegisterName("TextBlock1", Var_TextBox); or RegisterName(myRectAnimation.Name,myRectAnimation); RegisterName(myPath.Name,myPath);

提交回复
热议问题