小编SYB*_*SYB的帖子

WPF 自定义用户控件 - “成员 X 无法识别或无法访问”

我有这个自定义控件,但无法从我的主 XAML 访问它的成员

<UserControl x:Class="FireflyMmwDiagnostics.Controls.RegisterTextBox"
         xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
         xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
         xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
         mc:Ignorable="d" 
         d:DesignHeight="300" d:DesignWidth="300">
<Grid>
    <Label Name="LabelRegisterTitle"/>
</Grid>
Run Code Online (Sandbox Code Playgroud)

public partial class RegisterTextBox : UserControl
{
    public RegisterTextBox()
    {
        InitializeComponent();
    }

    public string RegisterTitle
    {
        get { return this.LabelRegisterTitle.Content.ToString(); }
        set { this.LabelRegisterTitle.Content = value; }
    }
Run Code Online (Sandbox Code Playgroud)

这就是我在 Main XAML 中遇到的错误,指出“成员 RegisterTitle 无法识别或无法访问”:

<Controls:RegisterTextBox RegisterTitle="This Is A Test"/>
Run Code Online (Sandbox Code Playgroud)

我看了几个 YouTube 视频,这正是他们所做的,并且出于某种原因对他们有用。请就此处可能出现的问题提供建议。谢谢!

c# wpf xaml

6
推荐指数
1
解决办法
8608
查看次数

C#将2 Int16连接到Int32

因为我认为应该是一个简单的解决方案,我遇到了一个死胡同.基本上,我有:

List<Uint16> header = new List<UInt16>();
Run Code Online (Sandbox Code Playgroud)

然后我用数据填充它,但后来我需要将几个元素加入到Int32中,我不知道最好的方法是什么.是否有任何.NET调用可以将这两个连接到Uint32?

谢谢

c# integer join

0
推荐指数
1
解决办法
1935
查看次数

标签 统计

c# ×2

integer ×1

join ×1

wpf ×1

xaml ×1