2020-10-23 21:24:32 +00:00
|
|
|
<Window x:Class="XIVChat_Desktop.MainWindow"
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
|
|
xmlns:local="clr-namespace:XIVChat_Desktop"
|
2020-11-09 21:31:28 +00:00
|
|
|
xmlns:cc="clr-namespace:XIVChat_Desktop.Controls"
|
2020-11-01 01:31:10 +00:00
|
|
|
xmlns:ui="http://schemas.modernwpf.com/2019"
|
2020-11-18 04:29:34 +00:00
|
|
|
xmlns:server="clr-namespace:XIVChatCommon.Message.Server;assembly=XIVChatCommon"
|
2020-11-01 01:31:10 +00:00
|
|
|
ui:WindowHelper.UseModernWindowStyle="True"
|
2020-11-13 02:18:49 +00:00
|
|
|
ui:TitleBar.ExtendViewIntoTitleBar="{Binding App.Config.CompactMode}"
|
2020-10-23 21:24:32 +00:00
|
|
|
mc:Ignorable="d"
|
2020-11-01 01:31:10 +00:00
|
|
|
Title="XIVChat for Windows"
|
|
|
|
Height="450"
|
|
|
|
Width="800"
|
|
|
|
x:Name="Main"
|
2020-11-13 02:18:49 +00:00
|
|
|
WindowStyle="None"
|
|
|
|
AllowsTransparency="True"
|
|
|
|
Opacity="{Binding App.Config.Opacity}"
|
2020-11-13 00:47:18 +00:00
|
|
|
Icon="/Resources/logo.ico"
|
2020-11-01 01:31:10 +00:00
|
|
|
d:DataContext="{d:DesignInstance local:MainWindow}">
|
2020-10-23 21:24:32 +00:00
|
|
|
<Grid>
|
|
|
|
<Grid.RowDefinitions>
|
2020-11-01 01:31:10 +00:00
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
<RowDefinition Height="Auto" />
|
2020-10-23 21:24:32 +00:00
|
|
|
</Grid.RowDefinitions>
|
2020-11-01 01:31:10 +00:00
|
|
|
<Menu Grid.Row="0">
|
2020-11-13 02:18:49 +00:00
|
|
|
<MenuItem Header="XIVChat"
|
|
|
|
WindowChrome.IsHitTestVisibleInChrome="{Binding App.Config.CompactMode}">
|
2020-11-01 01:31:10 +00:00
|
|
|
<MenuItem Header="Connect"
|
|
|
|
Click="Connect_Click"
|
2020-11-15 04:11:12 +00:00
|
|
|
IsEnabled="{Binding App.Connected, Converter={StaticResource NotConverter}, UpdateSourceTrigger=PropertyChanged}" />
|
2020-11-01 01:31:10 +00:00
|
|
|
<MenuItem Header="Disconnect"
|
|
|
|
Click="Disconnect_Click"
|
|
|
|
IsEnabled="{Binding App.Connected, UpdateSourceTrigger=PropertyChanged}" />
|
2020-11-06 20:19:42 +00:00
|
|
|
<MenuItem Header="Scan"
|
|
|
|
Click="Scan_Click" />
|
2020-11-01 01:31:10 +00:00
|
|
|
<Separator />
|
2020-11-11 02:56:04 +00:00
|
|
|
<MenuItem Header="Export"
|
|
|
|
Click="Export_Click" />
|
|
|
|
<Separator />
|
2020-11-12 02:25:59 +00:00
|
|
|
<MenuItem Header="Licence"
|
|
|
|
Click="Licence_Click" />
|
2020-11-01 01:31:10 +00:00
|
|
|
<MenuItem Header="Configuration"
|
|
|
|
Click="Configuration_Click" />
|
2020-11-13 02:18:49 +00:00
|
|
|
<Separator />
|
|
|
|
<MenuItem Header="Exit"
|
|
|
|
Click="Exit_Click" />
|
2020-11-01 01:31:10 +00:00
|
|
|
</MenuItem>
|
2020-11-13 04:53:21 +00:00
|
|
|
<MenuItem Header="Players"
|
|
|
|
WindowChrome.IsHitTestVisibleInChrome="{Binding App.Config.CompactMode}">
|
|
|
|
<MenuItem Header="Friend list"
|
|
|
|
Click="FriendList_Click" />
|
|
|
|
</MenuItem>
|
2020-10-23 21:24:32 +00:00
|
|
|
</Menu>
|
2020-11-01 01:31:10 +00:00
|
|
|
<TabControl x:Name="Tabs"
|
|
|
|
Margin="8,0,8,8"
|
|
|
|
TabStripPlacement="Bottom"
|
|
|
|
Grid.Row="1"
|
|
|
|
Loaded="Tabs_Loaded"
|
|
|
|
SelectionChanged="Tabs_SelectionChanged"
|
|
|
|
ItemsSource="{Binding App.Config.Tabs}">
|
2020-11-15 18:46:58 +00:00
|
|
|
<TabControl.CommandBindings>
|
|
|
|
<CommandBinding Command="local:MainWindow.AddTab"
|
|
|
|
Executed="AddTab_OnExecuted"
|
|
|
|
CanExecute="AlwaysTrue_CanExecute" />
|
|
|
|
<CommandBinding Command="local:MainWindow.ManageTabs"
|
|
|
|
Executed="ManageTabs_OnExecuted"
|
|
|
|
CanExecute="AlwaysTrue_CanExecute" />
|
|
|
|
<CommandBinding Command="local:MainWindow.EditTab"
|
|
|
|
Executed="EditTab_OnExecuted"
|
|
|
|
CanExecute="AlwaysTrue_CanExecute" />
|
|
|
|
<CommandBinding Command="local:MainWindow.DeleteTab"
|
|
|
|
Executed="DeleteTab_OnExecuted"
|
|
|
|
CanExecute="AlwaysTrue_CanExecute" />
|
|
|
|
</TabControl.CommandBindings>
|
|
|
|
|
|
|
|
<TabControl.Resources>
|
|
|
|
<Style TargetType="{x:Type MenuItem}"
|
|
|
|
BasedOn="{StaticResource DefaultMenuItemStyle}">
|
2020-11-15 19:16:00 +00:00
|
|
|
<!-- this is necessary to work around an issue where you have to select an item before commands check if they can execute -->
|
2020-11-15 18:46:58 +00:00
|
|
|
<Setter Property="CommandTarget"
|
2020-11-15 19:16:00 +00:00
|
|
|
Value="{Binding Path=PlacementTarget, RelativeSource={RelativeSource AncestorType={x:Type ContextMenu}}}" />
|
2020-11-15 18:46:58 +00:00
|
|
|
</Style>
|
|
|
|
|
|
|
|
<ContextMenu x:Key="TabContextMenu"
|
|
|
|
DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}"
|
|
|
|
d:DataContext="{d:DesignInstance local:Tab}">
|
|
|
|
<MenuItem Header="Edit"
|
|
|
|
Command="local:MainWindow.EditTab"
|
|
|
|
CommandParameter="{Binding}" />
|
|
|
|
<MenuItem Header="Delete"
|
|
|
|
Command="local:MainWindow.DeleteTab"
|
|
|
|
CommandParameter="{Binding}" />
|
|
|
|
</ContextMenu>
|
|
|
|
</TabControl.Resources>
|
|
|
|
|
|
|
|
<TabControl.ItemContainerStyle>
|
|
|
|
<Style TargetType="{x:Type TabItem}"
|
|
|
|
BasedOn="{StaticResource DefaultTabItemStyle}">
|
|
|
|
<Setter Property="ContextMenu"
|
|
|
|
Value="{StaticResource TabContextMenu}" />
|
|
|
|
</Style>
|
|
|
|
</TabControl.ItemContainerStyle>
|
|
|
|
|
|
|
|
<TabControl.ContextMenu>
|
|
|
|
<ContextMenu>
|
|
|
|
<MenuItem Header="Add tab"
|
|
|
|
Command="local:MainWindow.AddTab" />
|
|
|
|
<MenuItem Header="Manage tabs"
|
|
|
|
Command="local:MainWindow.ManageTabs" />
|
|
|
|
</ContextMenu>
|
|
|
|
</TabControl.ContextMenu>
|
|
|
|
|
2020-11-01 01:31:10 +00:00
|
|
|
<TabControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
|
|
|
<TextBlock Text="{Binding Name}" />
|
|
|
|
</DataTemplate>
|
|
|
|
</TabControl.ItemTemplate>
|
|
|
|
|
|
|
|
<TabControl.ContentTemplate>
|
|
|
|
<DataTemplate>
|
2020-11-09 21:31:28 +00:00
|
|
|
<Grid x:Name="TabGrid"
|
|
|
|
d:DataContext="{d:DesignInstance local:Tab}">
|
2020-11-01 01:31:10 +00:00
|
|
|
<Grid.RowDefinitions>
|
|
|
|
<RowDefinition Height="*" />
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
<RowDefinition Height="Auto" />
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
2020-11-07 00:46:42 +00:00
|
|
|
<ItemsControl Grid.Row="0"
|
|
|
|
x:Name="items"
|
|
|
|
Padding="4"
|
2020-11-08 01:10:10 +00:00
|
|
|
VirtualizingPanel.ScrollUnit="Pixel"
|
2020-11-07 00:46:42 +00:00
|
|
|
ItemsSource="{Binding .}">
|
|
|
|
<ItemsControl.Template>
|
|
|
|
<ControlTemplate TargetType="ItemsControl">
|
|
|
|
<ScrollViewer x:Name="scroller"
|
|
|
|
CanContentScroll="True"
|
|
|
|
Background="#333">
|
2020-11-08 01:10:10 +00:00
|
|
|
<ItemsPresenter Margin="0,0,16,0" />
|
2020-11-07 00:46:42 +00:00
|
|
|
</ScrollViewer>
|
|
|
|
</ControlTemplate>
|
|
|
|
</ItemsControl.Template>
|
2020-11-01 01:31:10 +00:00
|
|
|
|
2020-11-07 00:46:42 +00:00
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
|
<ItemsPanelTemplate>
|
|
|
|
<VirtualizingStackPanel IsVirtualizing="True"
|
|
|
|
VirtualizationMode="Recycling"
|
|
|
|
VerticalAlignment="Bottom" />
|
|
|
|
</ItemsPanelTemplate>
|
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
|
|
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
|
<DataTemplate>
|
2020-11-15 04:09:50 +00:00
|
|
|
<cc:MessageTextBlock
|
|
|
|
FontFamily="Global User Interface, /Resources/fonts/#XIV AXIS Std ATK"
|
|
|
|
ProcessMarkdown="{Binding DataContext.ProcessMarkdown, ElementName=TabGrid}"
|
2020-11-18 04:47:13 +00:00
|
|
|
Message="{Binding .}">
|
|
|
|
<cc:MessageTextBlock.CommandBindings>
|
|
|
|
<CommandBinding Command="local:MainWindow.MessageSendTell"
|
|
|
|
Executed="MessageSendTell_OnExecuted"
|
|
|
|
CanExecute="MessageSendTell_CanExecute" />
|
|
|
|
</cc:MessageTextBlock.CommandBindings>
|
|
|
|
|
|
|
|
<cc:MessageTextBlock.ContextMenu>
|
|
|
|
<ContextMenu
|
|
|
|
DataContext="{Binding PlacementTarget.DataContext, RelativeSource={RelativeSource Self}}"
|
|
|
|
d:DataContext="{d:DesignInstance server:ServerMessage}">
|
|
|
|
<MenuItem Header="Send /tell to sender"
|
|
|
|
Command="local:MainWindow.MessageSendTell"
|
|
|
|
CommandParameter="{Binding}" />
|
|
|
|
</ContextMenu>
|
|
|
|
</cc:MessageTextBlock.ContextMenu>
|
|
|
|
</cc:MessageTextBlock>
|
2020-11-07 00:46:42 +00:00
|
|
|
</DataTemplate>
|
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
|
</ItemsControl>
|
2020-11-01 01:31:10 +00:00
|
|
|
|
|
|
|
<TextBlock Margin="8,4,0,0"
|
|
|
|
Grid.Row="1"
|
|
|
|
Text="{Binding App.Connection.CurrentChannel, ElementName=Main, UpdateSourceTrigger=PropertyChanged}" />
|
2020-10-23 21:24:32 +00:00
|
|
|
|
2020-11-15 04:10:54 +00:00
|
|
|
<TextBox x:Name="InputBox"
|
|
|
|
ui:ControlHelper.PlaceholderText="{Binding InputPlaceholder, ElementName=Main, UpdateSourceTrigger=PropertyChanged}"
|
|
|
|
IsEnabled="{Binding App.Connection.Available, ElementName=Main, UpdateSourceTrigger=PropertyChanged, FallbackValue=False}"
|
|
|
|
Grid.Row="2"
|
|
|
|
Margin="0,0,0,8"
|
|
|
|
TextWrapping="Wrap"
|
|
|
|
SpellCheck.IsEnabled="True"
|
2020-11-18 02:52:21 +00:00
|
|
|
PreviewKeyDown="Input_Submit" />
|
2020-11-01 01:31:10 +00:00
|
|
|
</Grid>
|
|
|
|
</DataTemplate>
|
|
|
|
</TabControl.ContentTemplate>
|
|
|
|
</TabControl>
|
2020-11-13 02:18:49 +00:00
|
|
|
<StatusBar Grid.Row="2"
|
|
|
|
Visibility="{Binding App.Config.CompactMode, Converter={StaticResource InverseBoolToVisibilityConverter}}">
|
2020-11-01 01:31:10 +00:00
|
|
|
<StatusBarItem x:Name="LoggedInAs"
|
|
|
|
Content="Not logged in" />
|
|
|
|
<Separator x:Name="LoggedInAsSeparator"
|
|
|
|
Visibility="Collapsed" />
|
|
|
|
<StatusBarItem x:Name="CurrentWorld"
|
|
|
|
Visibility="Collapsed" />
|
|
|
|
<Separator x:Name="CurrentWorldSeparator"
|
|
|
|
Visibility="Collapsed" />
|
|
|
|
<StatusBarItem x:Name="Location"
|
|
|
|
Visibility="Collapsed" />
|
|
|
|
</StatusBar>
|
2020-10-23 21:24:32 +00:00
|
|
|
</Grid>
|
2020-11-06 00:48:21 +00:00
|
|
|
</Window>
|