We will create a simple application that will count odd and even numbers in a numeric range. This will be done on a non-UI thread and once the result is available we will update the UI. Follow these steps:
- From Solution Explorer, open the MainWindow.xaml file.
- Replace the existing Grid with the following simple user interface to provide the numeric range, and a button to calculate and display the result:
<Grid Margin="10"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> <RowDefinition Height="Auto"/> </Grid.RowDefinitions> <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="4"> <TextBlock Text="From:" Margin="4"/> <TextBox x:Name="fromValue" Text=...