Я тестирую привязку клавиатуры и текстового блока на основе образца UWP PhoneCall .
Однако, когда я запускаю свой код при нажатии на клавиатуре, нажатие клавиши не печатает на textblock
.
Я сделал некоторые изменения из примера кода. Я добавил ViewModels & Helpers из примеров.
Можете посоветовать, где я сделал не так?
Спасибо.
Мой XAML-код, как следует;
<TextBlock x:Name="KeypadDisplay" FontSize="50" TextAlignment="Right"
Text="{Binding DialerPhoneNumber.NumberToDial, Mode=OneWay}"
VerticalAlignment="Top" HorizontalAlignment="Left" Height="80" Width="300" Margin="70,20,0,0">
</TextBlock>
<Button Grid.Column="1" Grid.Row="1"
Command="{Binding ProcessDialPad}" Style="{StaticResource TextBlockButtonStyle}"
CommandParameter="1" Tag="1" HorizontalAlignment="Center" Height="30" Width="100">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="1" FontSize="18" FontWeight="Bold" Style="{StaticResource BodyTextBlockStyle}"/>
</StackPanel>
</Button>
<Button Grid.Column="2" Grid.Row="1"
Command="{Binding ProcessDialPad}" Style="{StaticResource TextBlockButtonStyle}"
CommandParameter="2" Tag="2" HorizontalAlignment="Center" Height="30" Width="100">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="2" FontSize="18" FontWeight="Bold" Style="{StaticResource BodyTextBlockStyle}"/>
</StackPanel>
</Button>
<Button Grid.Column="3" Grid.Row="1"
Command="{Binding ProcessDialPad}" Style="{StaticResource TextBlockButtonStyle}"
CommandParameter="3" Tag="3" HorizontalAlignment="Center" Height="30" Width="100">
<StackPanel Orientation="Vertical" HorizontalAlignment="Center">
<TextBlock Text="3" FontSize="18" FontWeight="Bold" Style="{StaticResource BodyTextBlockStyle}"/>
</StackPanel>
</Button>
Обновление - 03-07-2019
processdialpad
процедура выглядит следующим образом
public ICommand ProcessDialPad
{
get
{
if (dialPadCommand == null)
{
dialPadCommand = new RelayCommand(
this.DialPadInvoked);
}
return dialPadCommand;
}
}