|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<UserControl |
| 3 | + x:Class="CodeBreaker.WinUI.Views.Components.InfoBarArea" |
| 4 | + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 5 | + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 6 | + xmlns:local="using:CodeBreaker.WinUI.Views.Components" |
| 7 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
| 8 | + xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
| 9 | + xmlns:vmComponents="using:Codebreaker.ViewModels.Components" |
| 10 | + xmlns:converters="using:CodeBreaker.WinUI.Converters" |
| 11 | + xmlns:toolkitConverters="using:CommunityToolkit.WinUI.UI.Converters" |
| 12 | + mc:Ignorable="d"> |
| 13 | + <UserControl.Resources> |
| 14 | + <converters:InfoBarSeverityConverter x:Key="InfoBarSeverityConverter" /> |
| 15 | + <toolkitConverters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> |
| 16 | + </UserControl.Resources> |
| 17 | + <ListView ItemsSource="{x:Bind ViewModel.Messages, Mode=OneWay}" MaxHeight="200" IsItemClickEnabled="False" SelectionMode="None"> |
| 18 | + <ItemsControl.ItemTemplate> |
| 19 | + <DataTemplate x:DataType="vmComponents:InfoMessageViewModel"> |
| 20 | + <InfoBar |
| 21 | + Severity="{x:Bind Severity, Mode=OneTime, Converter={StaticResource InfoBarSeverityConverter}}" |
| 22 | + Title="{x:Bind Title, Mode=OneTime}" |
| 23 | + Message="{x:Bind Message, Mode=OneTime}" |
| 24 | + IsIconVisible="True" |
| 25 | + IsClosable="{x:Bind IsClosable, Mode=OneTime}" |
| 26 | + CloseButtonCommand="{x:Bind CloseCommand, Mode=OneTime}" |
| 27 | + IsOpen="True"> |
| 28 | + <InfoBar.ActionButton> |
| 29 | + <Button |
| 30 | + HorizontalAlignment="Right" |
| 31 | + Visibility="{x:Bind HasAction, Mode=OneTime, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=False}" |
| 32 | + Command="{x:Bind ExecuteActionCommand, Mode=OneTime}" |
| 33 | + Content="{x:Bind ActionText, Mode=OneTime}" /> |
| 34 | + </InfoBar.ActionButton> |
| 35 | + </InfoBar> |
| 36 | + </DataTemplate> |
| 37 | + </ItemsControl.ItemTemplate> |
| 38 | + </ListView> |
| 39 | +</UserControl> |
0 commit comments