7 个解决方案
#1
附上xaml
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PasswordChanged">
<i:InvokeCommandAction Command="{Binding SetPasswordCommand}"
CommandParameter="{Binding ElementName=passwordBox, Path=Password}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</PasswordBox>
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PasswordChanged">
<i:InvokeCommandAction Command="{Binding SetPasswordCommand}"
CommandParameter="{Binding ElementName=passwordBox, Path=Password}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</PasswordBox>
#2
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0" VerticalContentAlignment="Center">
#3
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0" VerticalContentAlignment="Center">
#4
呵呵,柳暗花明又一村啊,看了半天没看到,发完贴突然就找到了。
VerticalContentAlignment属性。
VerticalContentAlignment属性。
#5
兄弟你好快啊,那就给你吧
#6
private void SetSelection(PasswordBox passwordBox, int start, int length)
{
passwordBox.GetType()
.GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)
.Invoke(passwordBox, new object[] { start, length });
}
{
passwordBox.GetType()
.GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)
.Invoke(passwordBox, new object[] { start, length });
}
#7
解决了我的问题,哈哈,和lz的问题倒是无关
感谢!!!!!
#1
附上xaml
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PasswordChanged">
<i:InvokeCommandAction Command="{Binding SetPasswordCommand}"
CommandParameter="{Binding ElementName=passwordBox, Path=Password}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</PasswordBox>
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="PasswordChanged">
<i:InvokeCommandAction Command="{Binding SetPasswordCommand}"
CommandParameter="{Binding ElementName=passwordBox, Path=Password}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</PasswordBox>
#2
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0" VerticalContentAlignment="Center">
#3
<PasswordBox Height="36" Name="passwordBox" Margin="5" Padding="0" VerticalContentAlignment="Center">
#4
呵呵,柳暗花明又一村啊,看了半天没看到,发完贴突然就找到了。
VerticalContentAlignment属性。
VerticalContentAlignment属性。
#5
兄弟你好快啊,那就给你吧
#6
private void SetSelection(PasswordBox passwordBox, int start, int length)
{
passwordBox.GetType()
.GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)
.Invoke(passwordBox, new object[] { start, length });
}
{
passwordBox.GetType()
.GetMethod("Select", BindingFlags.Instance | BindingFlags.NonPublic)
.Invoke(passwordBox, new object[] { start, length });
}
#7
解决了我的问题,哈哈,和lz的问题倒是无关
感谢!!!!!