-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
327 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<phone:PhoneApplicationPage | ||
x:Class="sbbs_client_wp7.PostPage" | ||
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:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" | ||
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" | ||
FontFamily="{StaticResource PhoneFontFamilyNormal}" | ||
FontSize="{StaticResource PhoneFontSizeNormal}" | ||
Foreground="{StaticResource PhoneForegroundBrush}" | ||
SupportedOrientations="Portrait" Orientation="Portrait" | ||
mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480" | ||
toolkit:TiltEffect.IsTiltEnabled="True" | ||
shell:SystemTray.Opacity="{Binding IsLoading, Converter={StaticResource LoadedOpacityConerter}, ConverterParameter=true}" | ||
shell:SystemTray.IsVisible="True"> | ||
|
||
<shell:SystemTray.ProgressIndicator> | ||
<shell:ProgressIndicator Text="载入中..." | ||
IsVisible="{Binding IsLoading}" | ||
IsIndeterminate="{Binding IsLoading}"/> | ||
</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> | ||
|
||
<!--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> | ||
|
||
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> | ||
<TextBlock x:Name="Board" Text="版面" Style="{StaticResource PhoneTextNormalStyle}"/> | ||
<TextBlock x:Name="TypeTitle" Text="发帖" Margin="9,-7,0,0" Foreground="{StaticResource PhoneAccentBrush}" Style="{StaticResource PhoneTextExtraLargeStyle}"/> | ||
</StackPanel> | ||
|
||
<!--ContentPanel - place additional content here--> | ||
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> | ||
<Grid.RowDefinitions> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="Auto"/> | ||
<RowDefinition Height="*"/> | ||
</Grid.RowDefinitions> | ||
<TextBlock Text="标题" Style="{StaticResource PhoneTextGroupHeaderStyle}" /> | ||
<TextBox x:Name="TitleText" IsEnabled="{Binding IsLoading, Converter={StaticResource BoolReverseConverter}}" Grid.Row="1" /> | ||
<TextBlock Text="内容" Grid.Row="2" Style="{StaticResource PhoneTextGroupHeaderStyle}" /> | ||
<TextBox x:Name="ContentText" IsEnabled="{Binding IsLoading, Converter={StaticResource BoolReverseConverter}}" Grid.Row="3" /> | ||
</Grid> | ||
</Grid> | ||
|
||
<phone:PhoneApplicationPage.ApplicationBar> | ||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> | ||
<shell:ApplicationBarIconButton Click="Post_Click" IconUri="/Images/send.text.png" Text="发帖"/> | ||
<shell:ApplicationBarIconButton IconUri="/Images/attach.png" Text="附件"/> | ||
</shell:ApplicationBar> | ||
</phone:PhoneApplicationPage.ApplicationBar> | ||
|
||
</phone:PhoneApplicationPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Navigation; | ||
using System.Collections.ObjectModel; | ||
using Microsoft.Phone.Controls; | ||
|
||
namespace sbbs_client_wp7 | ||
{ | ||
using Sbbs; | ||
|
||
public partial class PostPage : PhoneApplicationPage | ||
{ | ||
private string board; | ||
private int reid = 0; | ||
private LoadingViewModel viewModel = new LoadingViewModel(); | ||
|
||
public PostPage() | ||
{ | ||
InitializeComponent(); | ||
|
||
DataContext = viewModel; | ||
} | ||
|
||
protected override void OnNavigatedTo(NavigationEventArgs e) | ||
{ | ||
base.OnNavigatedTo(e); | ||
|
||
if (this.NavigationContext.QueryString.ContainsKey("reid")) | ||
{ | ||
string title = this.NavigationContext.QueryString["title"]; | ||
if (title.Length > 3 && title.Substring(0, 3) == "Re:") | ||
TitleText.Text = title; | ||
else | ||
TitleText.Text = "Re: " + title; | ||
|
||
TypeTitle.Text = "回复"; | ||
Board.Text = board = this.NavigationContext.QueryString["board"]; | ||
reid = int.Parse(this.NavigationContext.QueryString["reid"]); | ||
} | ||
else | ||
{ | ||
TypeTitle.Text = "发帖"; | ||
Board.Text = board = this.NavigationContext.QueryString["board"]; | ||
} | ||
} | ||
|
||
private void Post_Click(object sender, EventArgs e) | ||
{ | ||
viewModel.IsLoading = true; | ||
|
||
App.Service.TopicPost(board, reid, TitleText.Text, ContentText.Text, delegate(ObservableCollection<TopicViewModel> topics, bool success, string error) | ||
{ | ||
viewModel.IsLoading = false; | ||
if (!success) | ||
MessageBox.Show("网络错误"); | ||
else if (error != null) | ||
MessageBox.Show(error); | ||
else | ||
{ | ||
// 跳转到版面时标记刷新 | ||
if (reid == 0) | ||
App.ViewModel.CurrentBoard.NeedRefresh = true; | ||
// 跳转到话题时直接在最后添加 | ||
else | ||
App.ViewModel.CurrentTopic.Topics.Add(topics[0]); | ||
|
||
NavigationService.GoBack(); | ||
} | ||
}); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<phone:PhoneApplicationPage | ||
x:Class="sbbs_client_wp7.SettingsPage" | ||
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" | ||
FontFamily="{StaticResource PhoneFontFamilyNormal}" | ||
FontSize="{StaticResource PhoneFontSizeNormal}" | ||
Foreground="{StaticResource PhoneForegroundBrush}" | ||
SupportedOrientations="Portrait" Orientation="Portrait" | ||
mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480" | ||
shell:SystemTray.IsVisible="True"> | ||
|
||
<!--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="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/> | ||
<TextBlock x:Name="PageTitle" Text="page name" 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"></Grid> | ||
</Grid> | ||
|
||
<!--Sample code showing usage of ApplicationBar--> | ||
<!--<phone:PhoneApplicationPage.ApplicationBar> | ||
<shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> | ||
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/> | ||
<shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/> | ||
<shell:ApplicationBar.MenuItems> | ||
<shell:ApplicationBarMenuItem Text="MenuItem 1"/> | ||
<shell:ApplicationBarMenuItem Text="MenuItem 2"/> | ||
</shell:ApplicationBar.MenuItems> | ||
</shell:ApplicationBar> | ||
</phone:PhoneApplicationPage.ApplicationBar>--> | ||
|
||
</phone:PhoneApplicationPage> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Net; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Animation; | ||
using System.Windows.Shapes; | ||
using Microsoft.Phone.Controls; | ||
|
||
namespace sbbs_client_wp7 | ||
{ | ||
public partial class SettingsPage : PhoneApplicationPage | ||
{ | ||
public SettingsPage() | ||
{ | ||
InitializeComponent(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.