forked from zcbenz/sbbs-client-wp7
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainPage.xaml
115 lines (108 loc) · 7.02 KB
/
MainPage.xaml
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
<phone:PhoneApplicationPage
x:Class="sbbs_client_wp7.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:local="clr-namespace:sbbs_client_wp7"
xmlns:custom="clr-namespace:CustomControls"
xmlns:sbbs="clr-namespace:Sbbs"
xmlns:motion="clr-namespace:MetroInMotionUtils"
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:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
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="800"
d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
shell:SystemTray.IsVisible="{Binding IsDataLoaded, Converter={StaticResource BoolReverseConverter}}"
shell:SystemTray.Opacity="0.5"
toolkit:TiltEffect.IsTiltEnabled="True">
<shell:SystemTray.ProgressIndicator>
<shell:ProgressIndicator Text="更新中..."
IsVisible="{Binding IsDataLoaded, Converter={StaticResource BoolReverseConverter}}"
IsIndeterminate="{Binding IsDataLoaded, Converter={StaticResource BoolReverseConverter}}"/>
</shell:SystemTray.ProgressIndicator>
<toolkit:TransitionService.NavigationInTransition>
<toolkit:NavigationInTransition>
<toolkit:NavigationInTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardIn"/>
</toolkit:NavigationInTransition.Backward>
<toolkit:NavigationInTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardIn"/>
</toolkit:NavigationInTransition.Forward>
</toolkit:NavigationInTransition>
</toolkit:TransitionService.NavigationInTransition>
<toolkit:TransitionService.NavigationOutTransition>
<toolkit:NavigationOutTransition>
<toolkit:NavigationOutTransition.Backward>
<toolkit:TurnstileTransition Mode="BackwardOut"/>
</toolkit:NavigationOutTransition.Backward>
<toolkit:NavigationOutTransition.Forward>
<toolkit:TurnstileTransition Mode="ForwardOut"/>
</toolkit:NavigationOutTransition.Forward>
</toolkit:NavigationOutTransition>
</toolkit:TransitionService.NavigationOutTransition>
<!--Panorama control-->
<controls:Panorama Title="虎踞龙蟠BBS" CacheMode="BitmapCache">
<controls:Panorama.TitleTemplate>
<DataTemplate>
<TextBlock Text="{Binding}" FontSize="90" Margin="10,60,0,0" />
</DataTemplate>
</controls:Panorama.TitleTemplate>
<!-- 十大热帖 -->
<controls:PanoramaItem>
<controls:PanoramaItem.Header>
<TextBlock motion:MetroInMotion.Tilt="6" Tap="RefreshTopten_Tap" Text="十大热帖" Foreground="{StaticResource PhoneAccentBrush}" FontSize="60"/>
</controls:PanoramaItem.Header>
<ListBox ItemsSource="{Binding ToptenItems}" ItemTemplate="{StaticResource TopicDataTemplate}"
SelectionChanged="Topten_Selected">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
</Style>
</ListBox.ItemContainerStyle>
</ListBox>
</controls:PanoramaItem>
<!-- 我的最爱 -->
<controls:PanoramaItem>
<controls:PanoramaItem.Header>
<TextBlock motion:MetroInMotion.Tilt="6" Tap="RefreshFavorates_Tap" Text="收藏夹" Foreground="{StaticResource PhoneAccentBrush}" FontSize="60"/>
</controls:PanoramaItem.Header>
<Grid>
<custom:RecursiveListBox ItemsSource="{Binding FavoratesItems}" ItemTemplate="{StaticResource BoardDataTemplate}"
Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}}"
LeafItemTap="Favorates_Selected"/>
<TextBlock Text="请在登录后使用收藏夹"
Opacity="0.7" FontSize="{StaticResource PhoneFontSizeLarge}"
Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}, ConverterParameter=true}"/>
</Grid>
</controls:PanoramaItem>
<!-- 我的账户 -->
<controls:PanoramaItem Orientation="Horizontal" Width="565">
<controls:PanoramaItem.Header>
<TextBlock Text="我的账户" Foreground="{StaticResource PhoneAccentBrush}" FontSize="60"/>
</controls:PanoramaItem.Header>
<toolkit:WrapPanel>
<toolkit:WrapPanel.Resources>
<Style TargetType="local:Tile">
<Setter Property="Margin" Value="5"/>
</Style>
</toolkit:WrapPanel.Resources>
<local:Tile Title="分区热点" Tag="HotPage.xaml?type=0" Tap="Tile_Tap" Src="/Images/Tiles/board.png"/>
<local:Tile Title="热门版面" Tag="HotPage.xaml?type=1" Tap="Tile_Tap" Src="/Images/Tiles/list.png"/>
<local:Tile Title="版面分区" Tag="HotPage.xaml?type=2" Tap="Tile_Tap" Src="/Images/Tiles/folder.png"/>
<!--<local:Tile Title="最近浏览" Tap="History_Tap" Src="/Images/Tiles/history.png"/>-->
<local:Tile Title="站内信" Tag="MailboxPage.xaml?type=0" Tap="Tile_Tap" Src="/Images/Tiles/mailbox.png" Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}}"/>
<!--<local:Tile Title="搜索" Tap="Search_Tap" Src="/Images/Tiles/search.png"/>-->
<local:Tile Title="关于" Tag="AboutPage.xaml" Tap="Tile_Tap" Src="/Images/Tiles/love.png"/>
<local:Tile Title="登录" Tag="LoginPage.xaml" Src="/Images/Tiles/pen.png" Tap="Tile_Tap" Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}, ConverterParameter=True}"/>
<local:Tile Title="注册" Tag="LoginPage.xaml?reg=1" Src="/Images/Tiles/cup.png" Tap="Tile_Tap" Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}, ConverterParameter=True}"/>
<local:Tile Title="退出" Src="/Images/Tiles/pen.png" Tap="Logout_Tap" Visibility="{Binding IsLogin, Converter={StaticResource BoolVisibleConverter}}"/>
</toolkit:WrapPanel>
</controls:PanoramaItem>
</controls:Panorama>
</phone:PhoneApplicationPage>