Skip to content
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
<Page x:Class="Uno.Gallery.Views.SamplePages.InfoBarSamplePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Uno.Gallery.Views.SamplePages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sample="using:Uno.Gallery"
xmlns:smtx="using:ShowMeTheXAML"
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">
<Page x:Class="Uno.Gallery.Views.SamplePages.InfoBarSamplePage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Uno.Gallery.Views.SamplePages"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sample="using:Uno.Gallery"
xmlns:smtx="using:ShowMeTheXAML"
xmlns:winui="using:Microsoft.UI.Xaml.Controls"
mc:Ignorable="d">

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<sample:SamplePageLayout>
<sample:SamplePageLayout.MaterialTemplate>
<DataTemplate>
<StackPanel Spacing="20"
Margin="0,20,0,0">
<Page.Resources>
<!-- Button Styles -->
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is anything lost by not basing these new styles on TextButtonStyle?
Such as Min sizes and different focus visuals?
Is this intentional/deliberate? All you've done is change the styles to use different colors and with no explanation of why.

<Style x:Key="ErrorButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Red" />
<Setter Property="Foreground" Value="White" />
</Style>

<Style x:Key="SuccessButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Blue" />
<Setter Property="Foreground" Value="White" />
</Style>

<Style x:Key="InformationButtonStyle" TargetType="Button">
<Setter Property="Background" Value="Yellow" />
<Setter Property="Foreground" Value="Black" />
</Style>
<!-- Add more styles as needed for different severities -->
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"severities" or "scenarios"?

</Page.Resources>

<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<sample:SamplePageLayout>
<sample:SamplePageLayout.MaterialTemplate>
<DataTemplate>
<StackPanel Spacing="20"
Margin="0,20,0,0">
<smtx:XamlDisplay UniqueKey="Material_InfoBarSamplePage_Error_SingleButton">
<winui:InfoBar x:Name="firstInfo"
Title="Title"
Expand All @@ -24,7 +43,7 @@
Severity="Error"
Style="{StaticResource MaterialInfoBarStyle}">
<winui:InfoBar.Content>
<Button Style="{StaticResource TextButtonStyle}"
<Button Style="{StaticResource ErrorButtonStyle}"
Content="DISMISS" />
</winui:InfoBar.Content>
<winui:InfoBar.IconSource>
Expand All @@ -45,9 +64,9 @@
<winui:InfoBar.Content>
<StackPanel Orientation="Horizontal"
Spacing="8">
<Button Style="{StaticResource TextButtonStyle}"
<Button Style="{StaticResource WarningButtonStyle}"
Content="DISMISS" />
<Button Style="{StaticResource TextButtonStyle}"
<Button Style="{StaticResource WarningButtonStyle}"
Content="ACTION" />
</StackPanel>
</winui:InfoBar.Content>
Expand All @@ -67,7 +86,7 @@
IsIconVisible="False"
Style="{StaticResource MaterialInfoBarStyle}">
<winui:InfoBar.Content>
<Button Style="{StaticResource TextButtonStyle}"
<Button Style="{StaticResource SuccessButtonStyle}"
Content="DISMISS" />
</winui:InfoBar.Content>
</winui:InfoBar>
Expand All @@ -83,7 +102,7 @@
IsIconVisible="True"
Style="{StaticResource MaterialInfoBarStyle}">
<winui:InfoBar.ActionButton>
<Button Style="{StaticResource TextButtonStyle}"
<Button Style="{StaticResource InformationButtonStyle}"
Content="DISMISS" />
</winui:InfoBar.ActionButton>
<winui:InfoBar.IconSource>
Expand All @@ -92,6 +111,41 @@
</winui:InfoBar.IconSource>
</winui:InfoBar>
</smtx:XamlDisplay>
<smtx:XamlDisplay UniqueKey="Material_InfoBarSamplePage_InProgress_SingleButton">
<winui:InfoBar x:Name="fifthInfo"
Title="Title"
IsOpen="True"
Message="Process is in progress. Please wait..."
Severity="Informational"
MinHeight="54"
IsIconVisible="True"
Style="{StaticResource MaterialInfoBarStyle}">
<Button Style="{StaticResource InformationButtonStyle}"
Content="DISMISS" />
</winui:InfoBar.Content>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing the winui:InfoBar.Content starting tag

<winui:InfoBar.IconSource>
<winui:BitmapIconSource UriSource="/Assets/MaterialIcon_Medium.png"
Foreground="{ThemeResource PrimaryBrush}" />
</winui:InfoBar.IconSource>
</winui:InfoBar>
</smtx:XamlDisplay>
<smtx:XamlDisplay UniqueKey="Material_InfoBarSamplePage_Timeout_SingleButton">
<winui:InfoBar x:Name="sixthInfo"
Title="Timeout/Expired"
IsOpen="True"
Message="The process has timed out or expired. Please try again."
Severity="Informational"
MinHeight="54"
IsIconVisible="True"
Style="{StaticResource MaterialInfoBarStyle}">
<Button Style="{StaticResource ErrorButtonStyle}"
Content="TRY AGAIN" />
<winui:InfoBar.IconSource>
<winui:BitmapIconSource UriSource="/Assets/MaterialIcon_Medium.png"
Foreground="{ThemeResource PrimaryBrush}" />
</winui:InfoBar.IconSource>
</winui:InfoBar>
</smtx:XamlDisplay>
</StackPanel>
</DataTemplate>
</sample:SamplePageLayout.MaterialTemplate>
Expand Down