Skip to content

Commit e8029ec

Browse files
author
msftbot[bot]
authored
Fix error message display for InAppNotification used in Sample App (#4061)
We missed updating a template somewhere, so fatal errors aren't displaying in the Sample App. Ideally this message never appears, this is being surfaced from our issues with `ICommand` in the ListView samples. #4039 ## PR Type What kind of change does this PR introduce? <!-- Please uncomment one or more that apply to this PR. --> <!-- - Bugfix --> <!-- - Feature --> <!-- - Code style update (formatting) --> <!-- - Refactoring (no functional changes, no api changes) --> <!-- - Build or CI related changes --> <!-- - Documentation content changes --> - Sample app changes <!-- - Other... Please describe: --> ## What is the current behavior? Error box appears blank. ## What is the new behavior? Error message shows exception message. ## PR Checklist Please check if your PR fulfills the following requirements: - [ ] Tested code with current [supported SDKs](../readme.md#supported) - [ ] Pull Request has been submitted to the documentation repository [instructions](..\contributing.md#docs). Link: <!-- docs PR link --> - [ ] Sample in sample app has been added / updated (for bug fixes / features) - [ ] Icon has been created (if new sample) following the [Thumbnail Style Guide and templates](https://github.com/windows-toolkit/WindowsCommunityToolkit-design-assets) - [ ] New major technical changes in the toolkit have or will be added to the [Wiki](https://github.com/windows-toolkit/WindowsCommunityToolkit/wiki) e.g. build changes, source generators, testing infrastructure, sample creation changes, etc... - [ ] Tests for the changes have been added (for bug fixes / features) (if applicable) - [ ] Header has been added to all new source files (run *build/UpdateHeaders.bat*) - [ ] Contains **NO** breaking changes <!-- If this PR contains a breaking change, please describe the impact and migration path for existing applications below. Please note that breaking changes are likely to be rejected within minor release cycles or held until major versions. --> ## Other information
2 parents ff21a8a + ee7c9db commit e8029ec

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Microsoft.Toolkit.Uwp.SampleApp/Pages/SampleController.xaml.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,9 +209,9 @@ protected override async void OnNavigatedTo(NavigationEventArgs e)
209209
method.Invoke(SamplePage, new object[] { e });
210210
}
211211
}
212-
catch
212+
catch (Exception ex)
213213
{
214-
ExceptionNotification.Show("Sample Page failed to load.");
214+
ExceptionNotification.Show("Sample Page failed to load: " + ex.Message);
215215
}
216216

217217
if (SamplePage != null)

Microsoft.Toolkit.Uwp.SampleApp/Styles/Generic.xaml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -600,15 +600,18 @@
600600
Foreground="DarkRed"
601601
Glyph="&#xEA39;" />
602602

603-
<ContentPresenter Grid.Column="1"
603+
<ContentPresenter x:Name="PART_Presenter"
604+
Grid.Column="1"
604605
HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
605-
VerticalAlignment="Center"
606+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
606607
HorizontalContentAlignment="Stretch"
607608
VerticalContentAlignment="Center"
609+
ContentTransitions="{TemplateBinding ContentTransitions}"
610+
FontWeight="SemiBold"
608611
TextWrapping="WrapWholeWords" />
609612

610613
<Button x:Name="PART_DismissButton"
611-
Grid.Column="3"
614+
Grid.Column="2"
612615
Margin="10,0,-10,0"
613616
AutomationProperties.Name="Dismiss"
614617
Content="&#xE894;"

0 commit comments

Comments
 (0)