Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TransformLayout 内部控件如何命名 #103

Open
brightbirghtlin5 opened this issue Jul 11, 2024 · 1 comment
Open

TransformLayout 内部控件如何命名 #103

brightbirghtlin5 opened this issue Jul 11, 2024 · 1 comment

Comments

@brightbirghtlin5
Copy link

brightbirghtlin5 commented Jul 11, 2024

在实际使用过程中,内部的文本或者图片是需要更换的,但是放在这个容器中会提示不允许命名。

严重性 代码 说明 项目 文件 行 禁止显示状态 详细信息
错误 MC3093 无法对元素“Image”设置 Name 特性值“imageAvatar”。“Image”在元素“TransformLayout”的范围内,在另一范围内定义它时,已注册了名称。

@zhaotianff
Copy link
Collaborator

zhaotianff commented Jul 22, 2024

我在示例代码中,直接将controls:TransformLayout内部控件TextBlock命名,编译是通过的。

  <controls:TransformLayout
      x:Name="MyTransformLayout"
      Canvas.Left="305"
      Canvas.Top="205"
      Width="280"
      Height="100">
      <TextBlock
          ...
          Name="Label"
          ...
      </TextBlock>
  </controls:TransformLayout>

你可以尝试使用x:Name来进行命名,像下面这样

 <TextBlock
          ...
          x:Name="Label"
          ...
 </TextBlock>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants