Skip to content

Commit

Permalink
进度条优化
Browse files Browse the repository at this point in the history
  • Loading branch information
zcbenz committed Mar 3, 2012
1 parent c861b3e commit 0c16edb
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 2 deletions.
1 change: 1 addition & 0 deletions App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<local:BoolVisibleConverter x:Key="BoolVisibleConverter" />
<local:BoolReverseConverter x:Key="BoolReverseConverter" />
<local:StampDateConverter x:Key="StampDateConverter" />
<local:LoadedOpacityConerter x:Key="LoadedOpacityConerter" />

<!--RichTextBlock默认样式-->
<Style TargetType="RichTextBox">
Expand Down
1 change: 1 addition & 0 deletions BoardPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
d:DataContext="{d:DesignData SampleData/CurrentBoardViewModelSampleData.xaml}"
shell:SystemTray.IsVisible="True"
shell:SystemTray.Opacity="{Binding IsLoaded, Converter={StaticResource LoadedOpacityConerter}}"
toolkit:TiltEffect.IsTiltEnabled="True">

<shell:SystemTray.ProgressIndicator>
Expand Down
1 change: 1 addition & 0 deletions TopicPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
shell:SystemTray.IsVisible="True"
shell:SystemTray.Opacity="{Binding IsLoaded, Converter={StaticResource LoadedOpacityConerter}}"
d:DataContext="{d:DesignData SampleData/CurrentTopicViewModelSampleData.xaml}">

<shell:SystemTray.ProgressIndicator>
Expand Down
28 changes: 28 additions & 0 deletions ValueConverters/LoadedOpacityConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Net;
using System.Windows;
using System.Windows.Data;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Globalization;

namespace sbbs_client_wp7
{
public class LoadedOpacityConerter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (bool)value ? 0 : 0.5;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return DependencyProperty.UnsetValue;
}
}
}
4 changes: 2 additions & 2 deletions ValueConverters/StampDateConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public object Convert(object value, Type targetType, object parameter, CultureIn
if (date.Year == now.Year && date.Month == now.Month && date.Day == now.Day)
return date.ToString("HH:mm", culture);
else if (date.Year == now.Year)
return date.ToString("MMM d HH:mm", culture);
return date.ToString("MM月d日 HH:mm", culture);
else
return date.ToString("y MMM d", culture);
return date.ToString("yyyy MM月d日", culture);
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Expand Down
1 change: 1 addition & 0 deletions sbbs-client-wp7.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
</Compile>
<Compile Include="ValueConverters\BoardValueConverter.cs" />
<Compile Include="ValueConverters\BoolConverter.cs" />
<Compile Include="ValueConverters\LoadedOpacityConverter.cs" />
<Compile Include="ValueConverters\RepliesHotConverter.cs" />
<Compile Include="Sbbs\BoardViewModel.cs" />
<Compile Include="Sbbs\TopicViewModel.cs" />
Expand Down

0 comments on commit 0c16edb

Please sign in to comment.