|
<phone:PhoneApplicationPage
x:Class="BonusBits.CodeSamples.WP7.ThreadingPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:local="clr-namespace:BonusBits.CodeSamples.WP7.Design.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="480"
d:DesignHeight="768"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait"
Orientation="Portrait"
shell:SystemTray.IsVisible="True">
<phone:PhoneApplicationPage.Resources>
<local:BooleanToVisibilityConverter
x:Key="booleanToVisibilityConverter" />
</phone:PhoneApplicationPage.Resources>
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid
x:Name="LayoutRoot"
Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition
Height="Auto" />
<RowDefinition
Height="*" />
</Grid.RowDefinitions>
<!--TitlePanel contains the name of the application and page title-->
<StackPanel
x:Name="TitlePanel"
Grid.Row="0"
Margin="12,17,0,28">
<TextBlock
x:Name="ApplicationTitle"
Text="BonusBits.CodeSamples.WP7"
Style="{StaticResource PhoneTextNormalStyle}" />
<TextBlock
x:Name="PageTitle"
Text="Threading"
Margin="9,-7,0,0"
Style="{StaticResource PhoneTextTitle1Style}" />
</StackPanel>
<!--ContentPanel - place additional content here-->
<Grid
x:Name="ContentPanel"
Grid.Row="1"
Margin="12,0,12,0">
<Button
IsEnabled="{Binding Path=CanStart}"
Height="72"
HorizontalAlignment="Left"
Margin="0,0,0,6"
Name="Start"
VerticalAlignment="Bottom"
Width="160">
<Button.Content>
<StackPanel
Orientation="Horizontal">
<TextBlock
Text="Start"
Margin="0,0,15,0" />
<Rectangle
Name="rectangle"
Fill="Gray"
Visibility="{Binding Path=CanExecuteWithSyncIO,
Converter={StaticResource booleanToVisibilityConverter},
ConverterParameter=!}"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="15"
Height="15">
<Rectangle.RenderTransform>
<RotateTransform
Angle="0"
CenterX="7.5"
CenterY="7.5" />
</Rectangle.RenderTransform>
<Rectangle.Triggers>
<EventTrigger
RoutedEvent="Rectangle.Loaded">
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="rectangle"
Storyboard.TargetProperty="(TextBlock.RenderTransform).(RotateTransform.Angle)"
From="0"
To="360"
Duration="0:0:5"
RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Rectangle.Triggers>
</Rectangle>
</StackPanel>
</Button.Content>
</Button>
<RadioButton
Content="Sync I/O"
Height="72"
HorizontalAlignment="Left"
Margin="12,6,0,0"
Name="CanExecuteWithSyncIO"
VerticalAlignment="Top" />
<RadioButton
Content="Delegate's BeginInvoke"
Height="72"
HorizontalAlignment="Left"
Margin="12,84,0,0"
Name="CanExecuteWithDelegateBeginInvoke"
VerticalAlignment="Top" />
<RadioButton
Content="IAsyncResult"
Height="72"
HorizontalAlignment="Left"
Margin="12,0,0,373"
Name="CanExecuteWithIAsyncResult"
VerticalAlignment="Bottom" />
<RadioButton
Content="AsyncEnumerator"
Height="72"
HorizontalAlignment="Left"
Margin="13,240,0,0"
Name="CanExecuteWithAsyncEnumerator"
VerticalAlignment="Top"
IsChecked="True" />
<TextBlock
Height="34"
HorizontalAlignment="Left"
Margin="161,547,0,0"
Name="Status"
Text="{Binding Path=Status}"
VerticalAlignment="Top"
Width="276"
TextWrapping="Wrap" />
</Grid>
</Grid>
</phone:PhoneApplicationPage>
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.