Subversion Repository Public Repository

Nextrek

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
<!-- 
    Copyright (c) 2011 Microsoft Corporation.  All rights reserved.
    Use of this sample source code is subject to the terms of the Microsoft license 
    agreement under which you licensed this sample source code and is provided AS-IS.
    If you did not accept the terms of the license agreement, you are not authorized 
    to use this sample source code.  For the terms of the license, please see the 
    license agreement between you and Microsoft.
    
    To see all Code Samples for Windows Phone, visit http://go.microsoft.com/fwlink/?LinkID=219604
-->
<phone:PhoneApplicationPage 
    x:Class="sdkBackgroundAudioPlayerCS.MainPage"
    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: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" xmlns:my="clr-namespace:Microsoft.Advertising.Mobile.UI;assembly=Microsoft.Advertising.Mobile.UI">

    <!--LayoutRoot is the root grid where all page content is placed-->
    <phone:PhoneApplicationPage.Resources>
        <Style x:Key="threeStateButtonStyle" TargetType="Button" >
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="normal" Storyboard.TargetProperty="Opacity" Duration="0" To="1"></DoubleAnimation>
                                        </Storyboard>
                                    </VisualState>
                                    <!--<VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="normal" Storyboard.TargetProperty="Opacity" Duration="0"  To="0"></DoubleAnimation>
                                            <DoubleAnimation Storyboard.TargetName="hover" Storyboard.TargetProperty="Opacity" Duration="0"  To="1"></DoubleAnimation>
                                        </Storyboard>
                                    </VisualState>-->
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimation Storyboard.TargetName="normal" Storyboard.TargetProperty="Opacity" Duration="0"  To="0"></DoubleAnimation>
                                            <DoubleAnimation Storyboard.TargetName="pressed" Storyboard.TargetProperty="Opacity" Duration="0"  To="1"></DoubleAnimation>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">

                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused">

                                    </VisualState>
                                    <VisualState x:Name="Unfocused" />
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border BorderBrush="WhiteSmoke" x:Name="normal" CornerRadius="2" BorderThickness="2" Opacity="1" Background="{TemplateBinding Background}" Margin="0" >

                            </Border>
                            <Border x:Name="hover" BorderBrush="WhiteSmoke" CornerRadius="2" BorderThickness="2" Opacity="0" Background="{TemplateBinding BorderBrush}" Margin="0" >
                            </Border>
                            <Border x:Name="pressed" BorderBrush="WhiteSmoke" CornerRadius="2" BorderThickness="2" Opacity="0" Background="{TemplateBinding Foreground}" Margin="0" >
                            </Border>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <ControlTemplate x:Key="PhoneSimpleRepeatButton" TargetType="RepeatButton">
            <Rectangle Fill="Transparent"/>
        </ControlTemplate>
        <ControlTemplate x:Key="ThumbControlTemplate1" TargetType="Thumb">
            <Rectangle Fill="#FF0E8D63"  Height="20" Width="30" />
        </ControlTemplate>

        <Style x:Key="SliderStyle1" TargetType="Slider">
            <Setter Property="BorderThickness" Value="0"/>
            <Setter Property="BorderBrush" Value="Transparent"/>
            <Setter Property="Maximum" Value="10"/>
            <Setter Property="Minimum" Value="0"/>
            <Setter Property="Value" Value="0"/>
            <Setter Property="Background" Value="{StaticResource PhoneContrastBackgroundBrush}"/>
            <Setter Property="Foreground" Value="{StaticResource PhoneAccentBrush}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Slider">
                        <Grid Background="Transparent">
                            <VisualStateManager.VisualStateGroups>
                                
                            </VisualStateManager.VisualStateGroups>
                            <Grid x:Name="HorizontalTemplate" Margin="{StaticResource PhoneHorizontalMargin}">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="0"/>
                                    <ColumnDefinition Width="*"/>
                                </Grid.ColumnDefinitions>
                                <Rectangle x:Name="HorizontalTrack" Grid.ColumnSpan="3" Fill="{TemplateBinding Background}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50" Opacity="0.2"/>
                                <Rectangle x:Name="HorizontalFill" Grid.Column="0" Fill="{TemplateBinding Foreground}" Height="12" IsHitTestVisible="False" Margin="0,22,0,50"/>
                                <RepeatButton x:Name="HorizontalTrackLargeChangeDecreaseRepeatButton" Grid.Column="0" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                                <RepeatButton x:Name="HorizontalTrackLargeChangeIncreaseRepeatButton" Grid.Column="2" IsTabStop="False" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                                <Thumb x:Name="HorizontalThumb" Grid.Column="1" Margin="-1,0,0,30" RenderTransformOrigin="0.5,0.5" Template="{StaticResource ThumbControlTemplate1}" Width="1">
                                    
                                        <Thumb.RenderTransform>
                                        <ScaleTransform ScaleY="1" ScaleX="20"/>
                                    </Thumb.RenderTransform>
                                </Thumb>
                            </Grid>
                            <Grid x:Name="VerticalTemplate" Margin="{StaticResource PhoneVerticalMargin}">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="*"/>
                                    <RowDefinition Height="0"/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Rectangle x:Name="VerticalTrack" Fill="{TemplateBinding Background}" IsHitTestVisible="False" Margin="12,0" Opacity="0.2" Grid.RowSpan="3" Width="12"/>
                                <Rectangle x:Name="VerticalFill" Fill="{TemplateBinding Foreground}" IsHitTestVisible="False" Margin="12,0" Grid.Row="2" Width="12"/>
                                <RepeatButton x:Name="VerticalTrackLargeChangeDecreaseRepeatButton" IsTabStop="False" Grid.Row="0" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                                <RepeatButton x:Name="VerticalTrackLargeChangeIncreaseRepeatButton" IsTabStop="False" Grid.Row="2" Template="{StaticResource PhoneSimpleRepeatButton}"/>
                                <Thumb x:Name="VerticalThumb" Height="1" Margin="0,1,0,0" Grid.Row="1" RenderTransformOrigin="0.5,0.5" Template="{StaticResource ThumbControlTemplate1}">
                                    <Thumb.RenderTransform>
                                        <ScaleTransform ScaleY="32" ScaleX="1"/>
                                    </Thumb.RenderTransform>
                                </Thumb>
                            </Grid>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>



    </phone:PhoneApplicationPage.Resources>

    
    
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="90"/>
            <RowDefinition Height="678*"/>
        </Grid.RowDefinitions>
        <MediaElement x:Name="mediaPlayer"></MediaElement>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Margin="0,0,0,1" Orientation="Vertical">
            <StackPanel.Background>
                <ImageBrush x:Name="myBrush1" ImageSource="/AudioBookCandeloraCS;component/Images/barraControllibianca.png" Stretch="Fill"></ImageBrush>
             </StackPanel.Background>
            <TextBlock x:Name="ApplicationTitle" Text="Letto da Emmanuele Rossi."  Style="{StaticResource PhoneTextNormalStyle}" Foreground="Black" Margin="120,0,0,0" />
            <Image x:Name="PageTitle"   Source="/AudioBookCandeloraCS;component/Images/barraControlli.png" Height="63" Width="407"></Image>
        </StackPanel>

        <!--ContentPanel - place additional content here-->
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="0,6,0,0">
         
            <Grid.RowDefinitions>
                <RowDefinition Height="645*" />
                <RowDefinition Height="27*" />
                <RowDefinition Height="0*" />
            </Grid.RowDefinitions>
            <StackPanel   Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Bottom" Height="71" Margin="0,0,81,6" Width="314" Grid.RowSpan="2">
                <StackPanel.Background>
                    <ImageBrush x:Name="myBrush"  ImageSource="/AudioBookCandeloraCS;component/Images/barraControllibianca.png" Stretch="Fill"></ImageBrush>

                </StackPanel.Background>
                <Image x:Name="PrevBtn" Source="/AudioBookCandeloraCS;component/Images/dietro.png" Width="100" Height="60" MouseLeftButtonUp="PrevBtn_MouseLeftButtonUp" ImageFailed="PrevBtn_ImageFailed" />
                <Image Height="60" x:Name="PlayBtn"  Source="/AudioBookCandeloraCS;component/Images/PalyerBtn.png" Width="100"  MouseLeftButtonUp="PlayBtn_MouseLeftButtonUp" Margin="0 0 10 0"/>
                <Image Height="60" x:Name="NextBtn"  Source="/AudioBookCandeloraCS;component/Images/avanti.png" Width="100" ImageFailed="NextBtn_ImageFailed_1" MouseLeftButtonUp="NextBtn_MouseLeftButtonUp_1" DataContext="{Binding}" MouseEnter="enter_click_nextMouse" MouseLeave="leave_click_nextMouse" />
            </StackPanel>
            <phone:WebBrowser HorizontalAlignment="Center"  Name="webBrowserTesto" VerticalAlignment="Bottom" Height="365" Width="464" Background="White" BorderBrush="Black" BorderThickness="3" FontSize="16" Visibility="Visible" Margin="6,0,10,166" Foreground="Black" />
            <my:AdControl AdUnitId="10032201" ApplicationId="0e3500ee-d766-401f-b992-d4d14e08a2a9" Height="77" HorizontalAlignment="Left" Margin="6,512,0,0" Name="adControl1" VerticalAlignment="Top" Width="464" ></my:AdControl>
            <HyperlinkButton Content="Scritto da Luigi Pirandello" Height="27" HorizontalAlignment="Left" Margin="175,479,0,0" Name="hyperlinkButton1" VerticalAlignment="Top" Width="297" Click="hyperlinkButton1_Click" Foreground="#FF0017B7" />
            
            <Button Height="60" HorizontalAlignment="Left" Name="button1" VerticalAlignment="Top" Width="48" Click="button1_Click" ClickMode="Release" Margin="10,600,0,0" Style="{StaticResource threeStateButtonStyle}" BorderBrush="White" HorizontalContentAlignment="Center" BorderThickness="3" Padding="0" Grid.RowSpan="2">
                <Button.Foreground>
                    <ImageBrush ImageSource="/AudioBookCandeloraCS;component/Images/index_disabled.png" Stretch="None" />
                </Button.Foreground>
                <Button.Background>
                    <ImageBrush ImageSource="/AudioBookCandeloraCS;component/Images/index.png" Stretch="None" />
                </Button.Background>
            </Button>
            <TextBlock x:Name="txtCurrentTrack"  Height="30" HorizontalAlignment="Left" VerticalAlignment="Top" Width="466" TextWrapping="Wrap" Margin="6,84,0,0" Foreground="#FF08A308" />
            <Button Height="60" Visibility="Collapsed" HorizontalAlignment="Right" Name="button2" VerticalAlignment="Top" Width="48" Padding="0" Margin="0,600,10,0" Style="{StaticResource threeStateButtonStyle}" Grid.RowSpan="2">
                <Button.Foreground>
                    <ImageBrush ImageSource="/AudioBookCandeloraCS;component/Images/autoscroll_disabled.png" Stretch="Fill" />
                </Button.Foreground>
                <Button.Background>
                    <ImageBrush ImageSource="/AudioBookCandeloraCS;component/Images/autoscroll.png" Stretch="Fill" />
                </Button.Background>
            </Button>
            <Slider Minimum="0"  Maximum="100" Style="{StaticResource SliderStyle1}"  Height="78" HorizontalAlignment="Right" Margin="0,0,6,0" Name="slider1" VerticalAlignment="Top" Width="464" Opacity="1" FontFamily="Segoe WP" FontStretch="Normal" IsHitTestVisible="True" ValueChanged="slider1_ValueChanged" ManipulationCompleted="soundSlider_manipulationCompleted" Cursor="Hand" Background="#FF005200" BorderBrush="Black" Foreground="#FF2295CE"/>
            

                <TextBlock Height="30" HorizontalAlignment="Left" Margin="36,48,0,0" x:Name="StartTextBlock" Text="00:00:00" VerticalAlignment="Top" Width="106" Foreground="Black" FontSize="22" />
            <TextBlock Height="30" HorizontalAlignment="Right" Margin="0,48,20,0" x:Name="EndTextBlock" Text="00:00:00" VerticalAlignment="Top" Width="96" Foreground="Black" FontSize="22" />
            <Canvas Name="indexCanvas" Width="458" Height="601" Visibility="Collapsed" Margin="10,-12,12,56" HorizontalAlignment="Center" VerticalAlignment="Center" Opacity="0.9">
                <ListBox Name="linkIndex" VerticalAlignment="Center" HorizontalAlignment="Center" Height="318" Width="272" FontFamily="Comic Sans MS" FontStretch="Expanded" FontSize="64" Foreground="White" FontWeight="Normal" FontStyle="Normal" Margin="150,38,58,298" Grid.Row="1" Canvas.Left="-54" Canvas.Top="69">
                    <HyperlinkButton Name="linkPag0" Content="Pirandello" Click="linkPag0_Click" HorizontalContentAlignment="Center" Foreground="Black" HorizontalAlignment="Stretch" FontSize="40" FontWeight="Normal" ></HyperlinkButton>
                    <HyperlinkButton Name="linkPag1" Content="Capitolo Uno" Click="linkPag1_Click" HorizontalContentAlignment="Center" Foreground="Black" FontSize="40" FlowDirection="LeftToRight"  Margin="0,10,0,0"></HyperlinkButton>
                    <HyperlinkButton Name="linkPag2" Content="Capitolo Due" Click="linkPag2_Click" HorizontalContentAlignment="Center" Foreground="Black" FontSize="40" Margin="0,10,0,0" ></HyperlinkButton>
                    <HyperlinkButton Name="linkPag3" Content="Capitolo Tre" Click="linkPag3_Click" HorizontalContentAlignment="Center" Foreground="Black" FontSize="40" Margin="0,10,0,0" ></HyperlinkButton>
                </ListBox>
                <Canvas.Background>
                    <ImageBrush ImageSource="/AudioBookCandeloraCS;component/Images/indexBackground.png" Stretch="UniformToFill" />
                </Canvas.Background>
            </Canvas>
        </Grid>
    </Grid>
</phone:PhoneApplicationPage>

Commits for Nextrek/WindowsPhone/AudioStory/Candelora/sdkBackgroundAudioPlayerCS/MainPage.xaml

Diff revisions: vs.
Revision Author Commited Message
6 FMMortaroli picture FMMortaroli Sat 20 Apr, 2013 15:30:47 +0000