<Window xmlns="https://github.com/avaloniaui"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="using:PhysOn.Desktop.ViewModels"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        x:Name="RootWindow"
        x:Class="PhysOn.Desktop.Views.MainWindow"
        x:DataType="vm:MainWindowViewModel"
        d:DesignWidth="1440"
        d:DesignHeight="900"
        Title="KoTalk"
        Width="1440"
        Height="900"
        MinWidth="980"
        MinHeight="640"
        Background="#F7F3EE">

    <Design.DataContext>
        <vm:MainWindowViewModel />
    </Design.DataContext>

    <Window.Styles>
        <Style Selector="Border.surface">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#E8DDD2" />
            <Setter Property="BorderThickness" Value="1" />
        </Style>
        <Style Selector="Border.surface-muted">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#FBF7F2" />
            <Setter Property="BorderBrush" Value="#ECE1D6" />
            <Setter Property="BorderThickness" Value="1" />
        </Style>
        <Style Selector="Border.rail-surface">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#E8DDD2" />
            <Setter Property="BorderThickness" Value="1" />
        </Style>
        <Style Selector="Border.row-card">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#ECE2D8" />
            <Setter Property="BorderThickness" Value="1" />
        </Style>
        <Style Selector="Border.row-card.active">
            <Setter Property="Background" Value="#F4ECE3" />
            <Setter Property="BorderBrush" Value="#DCCABA" />
        </Style>
        <Style Selector="Border.inline-alert">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#C9573C" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Padding" Value="10,8" />
        </Style>
        <Style Selector="Border.status-chip">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#FBF7F2" />
            <Setter Property="BorderBrush" Value="#E6D8CC" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Padding" Value="8,3" />
        </Style>
        <Style Selector="Border.unread-badge">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#394350" />
            <Setter Property="Padding" Value="6,1" />
        </Style>
        <Style Selector="Border.message-bubble">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Background" Value="#FBF7F2" />
            <Setter Property="BorderBrush" Value="#E6D8CC" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="MaxWidth" Value="560" />
            <Setter Property="Margin" Value="0,0,0,6" />
            <Setter Property="HorizontalAlignment" Value="Left" />
        </Style>
        <Style Selector="Border.message-bubble.mine">
            <Setter Property="Background" Value="#F0E5D8" />
            <Setter Property="HorizontalAlignment" Value="Right" />
        </Style>
        <Style Selector="Border.message-bubble.pending">
            <Setter Property="Opacity" Value="0.72" />
        </Style>
        <Style Selector="Border.message-bubble.failed">
            <Setter Property="BorderBrush" Value="#C9573C" />
        </Style>
        <Style Selector="TextBlock.display-title">
            <Setter Property="FontSize" Value="30" />
            <Setter Property="FontWeight" Value="SemiBold" />
            <Setter Property="Foreground" Value="#20242B" />
        </Style>
        <Style Selector="TextBlock.section-title">
            <Setter Property="FontSize" Value="15" />
            <Setter Property="FontWeight" Value="SemiBold" />
            <Setter Property="Foreground" Value="#20242B" />
        </Style>
        <Style Selector="TextBlock.body">
            <Setter Property="FontSize" Value="12.5" />
            <Setter Property="Foreground" Value="#2E3640" />
        </Style>
        <Style Selector="TextBlock.caption">
            <Setter Property="FontSize" Value="11.5" />
            <Setter Property="Foreground" Value="#82766D" />
        </Style>
        <Style Selector="TextBlock.eyebrow">
            <Setter Property="FontSize" Value="10.5" />
            <Setter Property="FontWeight" Value="SemiBold" />
            <Setter Property="Foreground" Value="#8B7B6C" />
        </Style>
        <Style Selector="TextBox.input">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="11,8" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#DCCFC4" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="FontSize" Value="13" />
        </Style>
        <Style Selector="TextBox.search-input">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="9,7" />
            <Setter Property="Background" Value="#FBF7F2" />
            <Setter Property="BorderBrush" Value="#E8DDD2" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="FontSize" Value="13" />
        </Style>
        <Style Selector="Button.primary-button">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="12,9" />
            <Setter Property="Background" Value="#394350" />
            <Setter Property="Foreground" Value="#FFFFFF" />
            <Setter Property="FontWeight" Value="SemiBold" />
        </Style>
        <Style Selector="Button.secondary-button">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="10,8" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="Foreground" Value="#394350" />
            <Setter Property="BorderBrush" Value="#DCCFC4" />
            <Setter Property="BorderThickness" Value="1" />
        </Style>
        <Style Selector="Button.icon-button">
            <Setter Property="Height" Value="30" />
            <Setter Property="MinWidth" Value="30" />
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="8,0" />
            <Setter Property="Background" Value="#FBF7F2" />
            <Setter Property="Foreground" Value="#394350" />
            <Setter Property="BorderBrush" Value="#E8DDD2" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="FontSize" Value="12" />
        </Style>
        <Style Selector="Button.icon-button.compact">
            <Setter Property="MinWidth" Value="28" />
            <Setter Property="Height" Value="28" />
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="6,0" />
            <Setter Property="FontSize" Value="11" />
        </Style>
        <Style Selector="Button.filter-button">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="9,5" />
            <Setter Property="Background" Value="#FBF7F2" />
            <Setter Property="Foreground" Value="#7F736A" />
            <Setter Property="BorderBrush" Value="#E8DDD2" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="FontSize" Value="12" />
        </Style>
        <Style Selector="Button.filter-button.selected">
            <Setter Property="Background" Value="#394350" />
            <Setter Property="Foreground" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#394350" />
        </Style>
        <Style Selector="Button.rail-button">
            <Setter Property="Width" Value="38" />
            <Setter Property="Height" Value="38" />
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="Foreground" Value="#394350" />
            <Setter Property="BorderBrush" Value="#E8DDD2" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="FontSize" Value="13" />
        </Style>
        <Style Selector="Button.rail-button.active">
            <Setter Property="Background" Value="#394350" />
            <Setter Property="Foreground" Value="#FFFFFF" />
            <Setter Property="BorderBrush" Value="#394350" />
        </Style>
        <Style Selector="Button.row-button">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="Padding" Value="0" />
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        </Style>
        <Style Selector="Button.quick-button">
            <Setter Property="CornerRadius" Value="2" />
            <Setter Property="Padding" Value="9,5" />
            <Setter Property="Background" Value="#FFFFFF" />
            <Setter Property="Foreground" Value="#7F736A" />
            <Setter Property="BorderBrush" Value="#E8DDD2" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="FontSize" Value="11.5" />
        </Style>
    </Window.Styles>

    <Grid Margin="12">
        <Grid IsVisible="{Binding ShowOnboarding}"
              HorizontalAlignment="Center"
              VerticalAlignment="Center"
              MaxWidth="380">
            <Border Classes="surface" Padding="22">
                <StackPanel Spacing="14">
                    <StackPanel Spacing="8">
                        <TextBlock Text="KO · TALK" Classes="eyebrow" />
                        <Border Width="50" Height="50" Classes="surface-muted" HorizontalAlignment="Left" Padding="7">
                            <Image Source="avares://PhysOn.Desktop/Assets/kotalk-mark-128.png"
                                   Stretch="Uniform" />
                        </Border>
                        <TextBlock Text="KoTalk" Classes="display-title" />
                    </StackPanel>

                    <TextBox Classes="input"
                             PlaceholderText="표시 이름"
                             Text="{Binding DisplayName}" />

                    <TextBox Classes="input"
                             PlaceholderText="참여 키"
                             Text="{Binding InviteCode}" />

                    <Grid ColumnDefinitions="Auto,*" ColumnSpacing="10">
                        <Button Classes="secondary-button"
                                Command="{Binding ToggleAdvancedSettingsCommand}"
                                Content="{Binding AdvancedSettingsButtonText}" />
                        <TextBox Grid.Column="1"
                                 Classes="input"
                                 IsVisible="{Binding ShowAdvancedSettings}"
                                 PlaceholderText="서버를 바꿀 때만 입력"
                                 Text="{Binding ApiBaseUrl}" />
                    </Grid>

                    <CheckBox Content="유지" IsChecked="{Binding RememberSession}" />

                    <Border Classes="inline-alert" IsVisible="{Binding HasErrorText}">
                        <TextBlock Text="{Binding ErrorText}"
                                   Classes="caption"
                                   Foreground="#C9573C"
                                   TextWrapping="Wrap" />
                    </Border>

                    <Button Classes="primary-button"
                            HorizontalAlignment="Stretch"
                            Command="{Binding SignInCommand}"
                            Content="열기" />
                </StackPanel>
            </Border>
        </Grid>

        <Grid IsVisible="{Binding ShowShell}">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="56" />
                <ColumnDefinition Width="{Binding ConversationPaneWidth}" />
                <ColumnDefinition Width="6" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Border Grid.Column="0" Classes="rail-surface" Padding="8">
                <Grid RowDefinitions="Auto,*,Auto">
                    <StackPanel Spacing="8">
                        <Border Width="38" Height="38" Classes="surface-muted" Padding="6">
                            <Image Source="avares://PhysOn.Desktop/Assets/kotalk-mark-128.png"
                                   Stretch="Uniform" />
                        </Border>

                        <Button Classes="rail-button active" ToolTip.Tip="받은함">
                            <TextBlock Text="⌂" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Button>
                    </StackPanel>

                    <StackPanel Grid.Row="2" Spacing="8">
                        <Border Width="38" Height="38" Classes="surface-muted">
                            <TextBlock HorizontalAlignment="Center"
                                       VerticalAlignment="Center"
                                       Text="{Binding CurrentUserMonogram}"
                                       FontWeight="SemiBold"
                                       Foreground="#394350" />
                        </Border>
                        <Button Classes="rail-button"
                                ToolTip.Tip="로그아웃"
                                Command="{Binding SignOutCommand}">
                            <TextBlock Text="⎋" HorizontalAlignment="Center" VerticalAlignment="Center" />
                        </Button>
                    </StackPanel>
                </Grid>
            </Border>

            <Border x:Name="ConversationPaneHost"
                    Grid.Column="1"
                    Classes="surface"
                    Padding="10"
                    IsVisible="{Binding IsConversationPaneExpanded}"
                    SizeChanged="ConversationPaneHost_OnSizeChanged">
                <Grid RowDefinitions="Auto,Auto,Auto,*" RowSpacing="8">
                    <Grid ColumnDefinitions="*" ColumnSpacing="10">
                        <TextBlock Text="받은함" Classes="section-title" />
                    </Grid>

                    <Grid Grid.Row="1" ColumnDefinitions="*,Auto,Auto" ColumnSpacing="8">
                        <TextBox Grid.Column="0"
                                 Classes="search-input"
                                 PlaceholderText="{Binding SearchWatermark}"
                                 Text="{Binding ConversationSearchText}" />
                        <Button Grid.Column="1"
                                Classes="icon-button"
                                ToolTip.Tip="밀도 전환"
                                Command="{Binding ToggleCompactModeCommand}"
                                Content="{Binding DensityGlyph}" />
                        <Button Grid.Column="2"
                                Classes="icon-button"
                                ToolTip.Tip="새로고침"
                                Command="{Binding ReloadCommand}"
                                Content="↻" />
                    </Grid>

                    <StackPanel Grid.Row="2" Orientation="Horizontal" Spacing="6">
                        <Button Classes="filter-button"
                                Classes.selected="{Binding IsAllFilterSelected}"
                                Command="{Binding ShowAllConversationsCommand}">
                            <StackPanel Orientation="Horizontal" Spacing="6">
                                <TextBlock Text="전체" />
                                <TextBlock Text="{Binding TotalConversationCount}" />
                            </StackPanel>
                        </Button>
                        <Button Classes="filter-button"
                                Classes.selected="{Binding IsUnreadFilterSelected}"
                                Command="{Binding ShowUnreadConversationsCommand}">
                            <StackPanel Orientation="Horizontal" Spacing="6">
                                <TextBlock Text="안읽음" />
                                <TextBlock Text="{Binding UnreadConversationCount}" />
                            </StackPanel>
                        </Button>
                        <Button Classes="filter-button"
                                Classes.selected="{Binding IsPinnedFilterSelected}"
                                Command="{Binding ShowPinnedConversationsCommand}">
                            <StackPanel Orientation="Horizontal" Spacing="6">
                                <TextBlock Text="고정" />
                                <TextBlock Text="{Binding PinnedConversationCount}" />
                            </StackPanel>
                        </Button>
                    </StackPanel>

                    <Grid Grid.Row="3">
                        <Border Classes="surface-muted"
                                Padding="18"
                                IsVisible="{Binding ShowConversationEmptyState}">
                            <StackPanel Spacing="10">
                                <TextBlock Text="{Binding ConversationEmptyStateText}" Classes="section-title" />
                                <StackPanel Orientation="Horizontal" Spacing="8">
                                    <Button Classes="secondary-button"
                                            Command="{Binding ShowAllConversationsCommand}"
                                            Content="전체" />
                                    <Button Classes="secondary-button"
                                            Command="{Binding ReloadCommand}"
                                            Content="새로고침" />
                                </StackPanel>
                            </StackPanel>
                        </Border>

                        <ScrollViewer IsVisible="{Binding HasFilteredConversations}">
                            <ItemsControl ItemsSource="{Binding FilteredConversations}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate x:DataType="vm:ConversationRowViewModel">
                                        <Button Classes="row-button"
                                                Margin="0,0,0,6"
                                                Command="{Binding $parent[Window].DataContext.SelectConversationCommand}"
                                                CommandParameter="{Binding .}">
                                            <Border Classes="row-card"
                                                    Classes.active="{Binding IsSelected}"
                                                    Padding="{Binding $parent[Window].DataContext.ConversationRowPadding}">
                                                <Grid ColumnDefinitions="Auto,*,Auto"
                                                      RowDefinitions="Auto,Auto"
                                                      ColumnSpacing="9"
                                                      RowSpacing="2">
                                                    <Border Width="{Binding $parent[Window].DataContext.ConversationAvatarSize}"
                                                            Height="{Binding $parent[Window].DataContext.ConversationAvatarSize}"
                                                            Classes="surface-muted">
                                                        <TextBlock HorizontalAlignment="Center"
                                                                   VerticalAlignment="Center"
                                                                   Text="{Binding AvatarText}"
                                                                   FontWeight="SemiBold"
                                                                   Foreground="#20242B" />
                                                    </Border>

                                                    <TextBlock Grid.Column="1"
                                                               Text="{Binding Title}"
                                                               Classes="body"
                                                               FontWeight="SemiBold"
                                                               TextTrimming="CharacterEllipsis" />
                                                    <TextBlock Grid.Column="2"
                                                               Text="{Binding MetaText}"
                                                               Classes="caption" />

                                                    <TextBlock Grid.Row="1"
                                                               Grid.Column="1"
                                                               Text="{Binding LastMessageText}"
                                                               Classes="caption"
                                                               TextTrimming="CharacterEllipsis" />

                                                    <StackPanel Grid.Row="1"
                                                                Grid.Column="2"
                                                                Orientation="Horizontal"
                                                                Spacing="6"
                                                                HorizontalAlignment="Right">
                                                        <TextBlock Text="★"
                                                                   Classes="caption"
                                                                   IsVisible="{Binding IsPinned}" />
                                                        <Border Classes="unread-badge"
                                                                IsVisible="{Binding HasUnread}">
                                                            <TextBlock Text="{Binding UnreadBadgeText}"
                                                                       FontSize="10.5"
                                                                       Foreground="#FFFFFF" />
                                                        </Border>
                                                    </StackPanel>
                                                </Grid>
                                            </Border>
                                        </Button>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </ScrollViewer>
                    </Grid>
                </Grid>
            </Border>

            <GridSplitter Grid.Column="2"
                          Width="6"
                          IsVisible="{Binding IsConversationPaneExpanded}"
                          Background="#E8DDD2"
                          ResizeDirection="Columns"
                          ShowsPreview="True" />

            <Border Grid.Column="3" Classes="surface" Padding="10">
                <Grid RowDefinitions="Auto,*,Auto" RowSpacing="10">
                    <Grid ColumnDefinitions="Auto,*,Auto,Auto,Auto" ColumnSpacing="8">
                        <Border Width="38" Height="38" Classes="surface-muted">
                            <TextBlock HorizontalAlignment="Center"
                                       VerticalAlignment="Center"
                                       Text="{Binding SelectedConversationGlyph}"
                                       FontWeight="SemiBold"
                                       Foreground="#20242B" />
                        </Border>

                        <StackPanel Grid.Column="1" Spacing="2">
                            <StackPanel Orientation="Horizontal" Spacing="8">
                                <TextBlock Text="{Binding SelectedConversationTitle}"
                                           Classes="section-title"
                                           TextTrimming="CharacterEllipsis" />
                                <Border Classes="status-chip" IsVisible="{Binding SelectedConversationIsPinned}">
                                    <TextBlock Text="고정" Classes="caption" />
                                </Border>
                                <Border Classes="unread-badge" IsVisible="{Binding HasSelectedConversationUnread}">
                                    <TextBlock Text="{Binding SelectedConversationUnreadBadgeText}"
                                               FontSize="10.5"
                                               Foreground="#FFFFFF" />
                                </Border>
                            </StackPanel>
                            <TextBlock Text="{Binding SelectedConversationSubtitle}"
                                       Classes="caption"
                                       TextTrimming="CharacterEllipsis" />
                        </StackPanel>

                        <Button Grid.Column="2"
                                Classes="icon-button"
                                ToolTip.Tip="목록 접기"
                                Command="{Binding ToggleConversationPaneCommand}"
                                Content="{Binding PaneActionGlyph}" />
                        <Button Grid.Column="3"
                                Classes="icon-button"
                                ToolTip.Tip="분리"
                                Command="{Binding DetachConversationCommand}"
                                Content="↗" />
                        <Button Grid.Column="4"
                                Classes="icon-button"
                                ToolTip.Tip="새로고침"
                                Command="{Binding ReloadCommand}"
                                Content="↻" />
                    </Grid>

                    <Grid Grid.Row="1">
                        <Border Classes="inline-alert"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Top"
                                Margin="0,0,0,8"
                                IsVisible="{Binding HasErrorText}">
                            <TextBlock Text="{Binding ErrorText}"
                                       Classes="caption"
                                       Foreground="#C9573C"
                                       TextWrapping="Wrap" />
                        </Border>

                        <ScrollViewer Name="MessagesScrollViewer"
                                      Margin="0,12,0,0"
                                      MaxWidth="860"
                                      HorizontalAlignment="Center">
                            <ItemsControl ItemsSource="{Binding Messages}">
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate x:DataType="vm:MessageRowViewModel">
                                        <Border Classes="message-bubble"
                                                Classes.mine="{Binding IsMine}"
                                                Classes.pending="{Binding IsPending}"
                                                Classes.failed="{Binding IsFailed}"
                                                Padding="{Binding $parent[Window].DataContext.MessageBubblePadding}">
                                            <StackPanel Spacing="4">
                                                <TextBlock Text="{Binding SenderName}"
                                                           Classes="caption"
                                                           FontWeight="SemiBold"
                                                           IsVisible="{Binding ShowSenderName}" />
                                                <TextBlock Text="{Binding Text}"
                                                           FontSize="13"
                                                           Foreground="#20242B"
                                                           TextWrapping="Wrap" />
                                                <TextBlock Text="{Binding MetaText}" Classes="caption" />
                                            </StackPanel>
                                        </Border>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </ScrollViewer>

                        <Border Classes="surface-muted"
                                Width="280"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Padding="14"
                                IsVisible="{Binding ShowMessageEmptyState}">
                            <StackPanel Spacing="10">
                                <TextBlock Text="{Binding MessageEmptyStateTitle}" Classes="section-title" />
                                <TextBlock Text="{Binding MessageEmptyStateText}" Classes="caption" TextWrapping="Wrap" />
                                <StackPanel Orientation="Horizontal" Spacing="8">
                                    <Button Classes="secondary-button"
                                            Command="{Binding DetachConversationCommand}"
                                            Content="분리 창" />
                                    <Button Classes="secondary-button"
                                            Command="{Binding ReloadCommand}"
                                            Content="새로고침" />
                                </StackPanel>
                            </StackPanel>
                        </Border>
                    </Grid>

                    <Border Grid.Row="2"
                            Classes="surface-muted"
                            Padding="8"
                            MaxWidth="860"
                            HorizontalAlignment="Center">
                        <Grid RowDefinitions="Auto,Auto" RowSpacing="6">
                            <StackPanel Orientation="Horizontal" Spacing="8">
                                <Button Classes="quick-button"
                                        ToolTip.Tip="확인"
                                        Command="{Binding ApplyAckDraftCommand}"
                                        Content="↺" />
                                <Button Classes="quick-button"
                                        ToolTip.Tip="공유"
                                        Command="{Binding ApplyShareDraftCommand}"
                                        Content="⇡" />
                                <Button Classes="quick-button"
                                        ToolTip.Tip="할 일"
                                        Command="{Binding ApplyTaskDraftCommand}"
                                        Content="☑" />
                            </StackPanel>

                            <Grid Grid.Row="1"
                                  ColumnDefinitions="*,Auto"
                                  ColumnSpacing="10">
                                <TextBox Name="ComposerTextBox"
                                         Classes="input"
                                         PlaceholderText="{Binding ComposerPlaceholderText}"
                                         AcceptsReturn="True"
                                         TextWrapping="Wrap"
                                         MinHeight="{Binding ComposerMinHeight}"
                                         Text="{Binding ComposerText}"
                                         KeyDown="ComposerTextBox_OnKeyDown" />

                                <StackPanel Grid.Column="1"
                                            Spacing="6"
                                            HorizontalAlignment="Right">
                                    <Button Classes="primary-button"
                                            MinWidth="74"
                                            Command="{Binding SendMessageCommand}"
                                            Content="{Binding ComposerActionText}" />
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </Border>
                </Grid>
            </Border>
        </Grid>
    </Grid>
</Window>
