Нейминг в юзер контролах xamarin
Создал юзер контрол для валидации пароля в Xamarin, в форме есть Entry и Label для отображения ошибок пароля, например, символов недостаточно и тд. Использую я его в нескольких вьюшках следующим образом:
<controls:PasswordEntry
PasswordText="{Binding Password}"
PasswordError="{Binding PasswordError}"
IsPasswordIncorrect="{Binding PasswordIncorrect}"
Grid.Row="1" />
Код выше работает отлично, но если PasswordText != "Password", то все ломается, следующий код уже не работает
<controls:PasswordEntry Grid.Row="1"
PasswordText="{Binding NewPassword}"
PasswordError="{Binding NewPasswordError}"
IsPasswordIncorrect="{Binding NewPasswordIncorrect}"/>
Это вынужденная мера, т.к. в одной форме я использую несколько юзер контролов. Код юзер контрола:
<ContentView.Content>
<StackLayout>
<Frame x:Name="PasswordFrame" Padding="0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Entry Grid.Row="0"
x:Name="Password"
Text="{Binding Password}"
IsPassword="True" />
<Label Grid.Row="1"
x:Name="PasswordErrorLabel"
TextColor="{DynamicResource ErrorColor}"
Padding="2" />
</Grid>
</Frame>
</StackLayout>
</ContentView.Content>
public string PasswordText {
get => (string) GetValue(PasswordTextProperty);
set => SetValue(PasswordTextProperty, value);
}
public static readonly BindableProperty PasswordTextProperty = BindableProperty.Create(
"PasswordText",
typeof(string),
typeof(PasswordEntry),
"",
BindingMode.TwoWay,
propertyChanged: PasswordTextPropertyChanged);
По моему мнению, это не работает из за нейминга, т.е. ели поле не Password, а например Password1, или PasswordF, то ничего не работает