C# 및 .NET Framework 4.5.1을 사용하여 Windows 8.1 Store 앱을 개발 중입니다. ViewModel에 뷰 컨트롤 넣기
은 내가 뷰 모델에 Password.SecurePassword를 결합하려고, 나는 그것을 할 수있는 방법을 발견이 SO answer을 읽고 있어요 : 넣어PasswordBox
을 내
ViewModel
에.
하지만 어떻게해야할지 모르겠다. Dependency Properties를 바인딩하는 방법을 알고 있지만 ViewModel에 컨트롤을 두는 방법을 모르겠습니다. 내 XAML입니다.
<Page
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
DataContext="{Binding MainViewModel, Source={StaticResource Locator}}"
mc:Ignorable="d">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<PasswordBox x:Name="userPassword" />
</Grid>
</Page>
무엇을해야합니까?
당신이 연결하는 포스트는'PassWord' (그것은 DP가 아닙니다)와 해결책을위한 특정 문제를 구체화합니다. 그것보다 쉽지는 않을 것입니다. –
어쩌면 해당 게시물이 도움이 될 것입니다 http://stackoverflow.com/questions/1483892/how-to-bind-to-a-passwordbox-in-mvvm –