Skip to content

Commit

Permalink
修复下载What's news页面内容的报错问题;修复切换画中画模式后隐式动画出错的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
DinoChan committed Aug 28, 2019
1 parent cccda07 commit 264934d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 0 additions & 2 deletions OnePomodoro/OnePomodoro/Views/CompactPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,10 @@ private void UpdateTitleBarLayout(CoreApplicationViewTitleBar coreTitleBar)

private async void OnUnpinClick(object sender, RoutedEventArgs e)
{

if (Frame.CanGoBack)
Frame.GoBack();

var preferences = ViewModePreferences.CreateDefault(ApplicationViewMode.Default);
//pref.CustomSize = new Windows.Foundation.Size(800, 600);
await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.Default, preferences);
}
}
Expand Down
7 changes: 5 additions & 2 deletions OnePomodoro/OnePomodoro/Views/MainPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public sealed partial class MainPage : Page

private Type _pomodoroViewType;

private bool _isInCompactMode;

public MainPage()
{
InitializeComponent();
Expand All @@ -43,11 +45,11 @@ protected override void OnNavigatedTo(NavigationEventArgs e)
if (viewType == null)
viewType = PomodoroView.Views.FirstOrDefault();

if (_pomodoroViewType != viewType)
if (_pomodoroViewType != viewType || _isInCompactMode)
ChangePomodoroContent(viewType);

_pomodoroViewType = viewType;

_isInCompactMode = false;
Window.Current.SetTitleBar(AppTitleBar);
}

Expand Down Expand Up @@ -80,6 +82,7 @@ private async void OnPinClick(object sender, RoutedEventArgs e)
preferences.CustomSize = new Windows.Foundation.Size(200, 200);
await ApplicationView.GetForCurrentView().TryEnterViewModeAsync(ApplicationViewMode.CompactOverlay, preferences);
Frame.Navigate(typeof(CompactPage));
_isInCompactMode = true;
}

private void OnFullScreenClick(object sender, RoutedEventArgs e)
Expand Down
12 changes: 9 additions & 3 deletions OnePomodoro/OnePomodoro/Views/OptionsPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,15 @@ protected async override void OnNavigatedTo(NavigationEventArgs e)

if (WhatsNewMarkdownTextBlock.Text != null)
{
HttpClient client = new HttpClient();
var text = await client.GetStringAsync("https://raw.githubusercontent.com/DinoChan/OnePomodoro/master/Whats%20new.md?_sm_au_=iVVWJ65DN15Rbq16"); ;
WhatsNewMarkdownTextBlock.Text = text;
try
{
HttpClient client = new HttpClient();
var text = await client.GetStringAsync("https://raw.githubusercontent.com/DinoChan/OnePomodoro/master/Whats%20new.md?_sm_au_=iVVWJ65DN15Rbq16"); ;
WhatsNewMarkdownTextBlock.Text = text;
}
catch (Exception)
{
}
}
}

Expand Down

0 comments on commit 264934d

Please sign in to comment.