简体   繁体   English

WP8-C#-从Telerik RadPickerBox获取对象值

[英]WP8 - C# - Getting object value from Telerik RadPickerBox

I am currently having an issue regarding this component. 我目前对此组件有疑问。 This is the xaml usage of it in my app: 这是它在我的应用中的xaml用法:

<telerikPrimitives:RadPickerBox x:Name="box_change" Width="0">
    <StackPanel Background="White">
            <StackPanel Height="618">
                    <PasswordBox Name="NewPassword1" Padding="2,8,2,8" Margin="10,0,10,0" Style="{StaticResource PasswordBoxStyle}" />
        </StackPanel>
    </StackPanel>
</telerikPrimitives:RadPickerBox>

I am currently in need of retrieving, from my C# code, the value "password" of the field "NewPassword1", still I am unable to do that. 我目前需要从我的C#代码中检索字段“ NewPassword1”的值“ password”,但仍然无法执行此操作。 I already tried retrieving it with something like this: 我已经尝试过用以下方法检索它:

box_change.NewPassword1.Password box_change.NewPassword1.Password

but, of course, else I wouldn't be asking this question right now, this way doesn't work. 但是,当然,否则我现在不会问这个问题,这种方式行不通。

What would you suggest to retrieve the value? 您建议如何检索该值?

Thanks in advance, 提前致谢,

Guido 圭多

this.NewPassword1.Password

乐意效劳!

Have you considered using Telerik's RadPasswordBox for WP8 ? 您是否考虑过将Telerik的RadPasswordBox用于WP8 It's optimized for passwords with masking characters and other features (and easily provides you with the password): 它针对具有屏蔽字符和其他功能的密码进行了优化(并轻松为您提供了密码):

var userEnteredPassword = myPasswordBox.Password;

That being said, even though your PasswordBox is the child of two StackPanels, you can access the Password box in the same scope via NewPassword1. 话虽如此,即使您的PasswordBox是两个StackPanels的子代,您也可以通过NewPassword1访问同一作用域中的Password框。 If you have more complex controls see the control's documentation on how to get the value of a child element. 如果您有更复杂的控件, 请参见控件的文档 ,了解如何获取子元素的值。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM