You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
911 B
43 lines
911 B
1 year ago
|
namespace Phoneword;
|
||
|
|
||
|
public class TestPage : ContentPage
|
||
|
{
|
||
|
int count = 0;
|
||
|
|
||
|
Label counterLabel;
|
||
|
|
||
|
public TestPage()
|
||
|
{
|
||
|
ScrollView myScrollView = new ScrollView();
|
||
|
VerticalStackLayout myStackLayout = new VerticalStackLayout();
|
||
|
myScrollView.Content = myStackLayout;
|
||
|
|
||
|
counterLabel = new Label()
|
||
|
{
|
||
|
Text = "Current count: 0",
|
||
|
FontSize = 18,
|
||
|
FontAttributes = FontAttributes.Bold,
|
||
|
HorizontalOptions = LayoutOptions.Center,
|
||
|
};
|
||
|
myStackLayout.Children.Add(counterLabel);
|
||
|
|
||
|
Button myButton = new Button()
|
||
|
{
|
||
|
Text = "Click me",
|
||
|
HorizontalOptions = LayoutOptions.Center,
|
||
|
};
|
||
|
myStackLayout.Children.Add(myButton);
|
||
|
|
||
|
myButton.Clicked += MyButton_Clicked;
|
||
|
|
||
|
Content = myScrollView;
|
||
|
}
|
||
|
|
||
|
private void MyButton_Clicked(object sender, EventArgs e)
|
||
|
{
|
||
|
count++;
|
||
|
counterLabel.Text = $"Current count: {count}";
|
||
|
|
||
|
SemanticScreenReader.Announce(counterLabel.Text);
|
||
|
}
|
||
|
}
|