<commit_before>﻿<UserControl x:Class="OQF.Net.DesktopClient.Visualization.Views.NetworkView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:computations="clr-namespace:OQF.Net.DesktopClient.Visualization.Computations"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:helper="clr-namespace:OQF.Net.DesktopClient.Visualization.ViewModels.MainWindow.Helper"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:networkView="clr-namespace:OQF.Net.DesktopClient.Visualization.ViewModels.NetworkView"
             d:DesignHeight="700"
             d:DesignWidth="300"
             mc:Ignorable="d">

    <d:DesignData.DataContext>
        <networkView:NetworkViewModelSampleData />
    </d:DesignData.DataContext>

    <UserControl.Resources>
        <computations:ConnectionPanelVisibility x:Key="ConnectionPanelVisibility" />
        <computations:DisconnectPanelVisibility x:Key="DisconnectPanelVisibility" />
        <computations:ConnectionDisplayText x:Key="ConnectionDisplayText" />
        <computations:ConnectionDisplayBackground x:Key="ConnectionDisplayBackground" />
        <computations:CreateGamePanelVisibility x:Key="CreateGamePanelVisibility" />
        <computations:LeaveGamePanelVisiblity x:Key="LeaveGamePanelVisiblity" />
        <computations:CancelGamePanelVisibility x:Key="CancelGamePanelVisibility" />
    </UserControl.Resources>

    <StackPanel Width="300">

		<Grid Margin="0,0,0,16" Visibility="{Binding ConnectionStatus, Converter={StaticResource ConnectionPanelVisibility}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="8" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="8" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
                <TextBlock Margin="0,0,0,8"
                           Style="{StaticResource MaterialDesignSubheadingTextBlock}"
                           Text="{Binding ServerAddressPromt}" />
                <TextBox materialDesign:HintAssist.Hint="{Binding ServerAddressHint}" 
						 Text="{Binding ServerAddress, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            </StackPanel>
            <StackPanel Grid.Row="2">
                <TextBlock Margin="0,8,0,8"
                           Style="{StaticResource MaterialDesignSubheadingTextBlock}"
                           Text="{Binding PlayerNamePromt}" />
                <TextBox materialDesign:HintAssist.Hint="{Binding PlayerNameHint}" 
						 Text="{Binding PlayerName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
            </StackPanel>
            <StackPanel Grid.Row="4">
                <Button Margin="8,0"
                        Command="{Binding ConnectToServer}"
                        Content="{Binding ConnectToServerButtonCaption}" />
                <StackPanel Margin="0,16,8,0" Orientation="Horizontal">
                    <Ellipse Width="16"
                             Height="16"
                             Fill="{Binding ConnectionStatus,
                                            Converter={StaticResource ConnectionDisplayBackground}}" />
                    <TextBlock Margin="8,0,0,0" VerticalAlignment="Center">

                        <TextBlock.Text>
                            <MultiBinding Converter="{StaticResource ConnectionDisplayText}">
                                <Binding Path="ConnectionStatus" />
                                <Binding Path="GameStatus" />
                            </MultiBinding>
                        </TextBlock.Text>

                    </TextBlock>
                </StackPanel>
            </StackPanel>
        </Grid>



        <StackPanel Margin="0,0,0,16" Visibility="{Binding ConnectionStatus, Converter={StaticResource DisconnectPanelVisibility}}">

            <Button Margin="8,0"
                    Command="{Binding DisconnectFromServer}"
                    Content="{Binding DisconnectFromServerButtonsCaptions}" />

        </StackPanel>


        <Grid>
            <Grid.Visibility>
                <MultiBinding Converter="{StaticResource CreateGamePanelVisibility}">
                    <Binding Path="ConnectionStatus" />
                    <Binding Path="GameStatus" />
                </MultiBinding>
            </Grid.Visibility>
			
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="16" />
                <RowDefinition />
                <RowDefinition Height="8" />
                <RowDefinition />
            </Grid.RowDefinitions>
			
            <StackPanel Grid.Row="0">
                <TextBlock Margin="0,0,0,8"
                           Style="{StaticResource MaterialDesignSubheadingTextBlock}"
                           Text="{Binding NewGameNamePromt}" />
                <TextBox materialDesign:HintAssist.Hint="{Binding NewGameNameHint}" 
						 Text="{Binding NewGameName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                <Button Margin="8"<commit_msg>Network.DesktopClient: textboxes accept return like button-click<commit_after>﻿<UserControl x:Class="OQF.Net.DesktopClient.Visualization.Views.NetworkView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:computations="clr-namespace:OQF.Net.DesktopClient.Visualization.Computations"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:helper="clr-namespace:OQF.Net.DesktopClient.Visualization.ViewModels.MainWindow.Helper"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:networkView="clr-namespace:OQF.Net.DesktopClient.Visualization.ViewModels.NetworkView"
             xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity"
             xmlns:commandExecutingBehaviors="clr-namespace:Lib.Wpf.CommandExecutingBehaviors;assembly=Lib.Wpf"
             d:DesignHeight="700"
             d:DesignWidth="300"
             mc:Ignorable="d">

    <d:DesignData.DataContext>
        <networkView:NetworkViewModelSampleData />
    </d:DesignData.DataContext>

    <UserControl.Resources>
        <computations:ConnectionPanelVisibility x:Key="ConnectionPanelVisibility" />
        <computations:DisconnectPanelVisibility x:Key="DisconnectPanelVisibility" />
        <computations:ConnectionDisplayText x:Key="ConnectionDisplayText" />
        <computations:ConnectionDisplayBackground x:Key="ConnectionDisplayBackground" />
        <computations:CreateGamePanelVisibility x:Key="CreateGamePanelVisibility" />
        <computations:LeaveGamePanelVisiblity x:Key="LeaveGamePanelVisiblity" />
        <computations:CancelGamePanelVisibility x:Key="CancelGamePanelVisibility" />
    </UserControl.Resources>

    <StackPanel Width="300">

		<Grid Margin="0,0,0,16" Visibility="{Binding ConnectionStatus, Converter={StaticResource ConnectionPanelVisibility}}">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="8" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="8" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <StackPanel Grid.Row="0">
                <TextBlock Margin="0,0,0,8"
                           Style="{StaticResource MaterialDesignSubheadingTextBlock}"
                           Text="{Binding ServerAddressPromt}" />
                <TextBox materialDesign:HintAssist.Hint="{Binding ServerAddressHint}" 
						 Text="{Binding ServerAddress, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >

					<i:Interaction.Behaviors>
						<commandExecutingBehaviors:ExecuteCommandOnEnter Command="{Binding ConnectToServer}"/>
					</i:Interaction.Behaviors>
					
				</TextBox>
            </StackPanel>
            <StackPanel Grid.Row="2">
                <TextBlock Margin="0,8,0,8"
                           Style="{StaticResource MaterialDesignSubheadingTextBlock}"
                           Text="{Binding PlayerNamePromt}" />
                <TextBox materialDesign:HintAssist.Hint="{Binding PlayerNameHint}" 
						 Text="{Binding PlayerName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >

					<i:Interaction.Behaviors>
						<commandExecutingBehaviors:ExecuteCommandOnEnter Command="{Binding ConnectToServer}"/>
					</i:Interaction.Behaviors>

				</TextBox>
            </StackPanel>
            <StackPanel Grid.Row="4">
                <Button Margin="8,0"
                        Command="{Binding ConnectToServer}"
                        Content="{Binding ConnectToServerButtonCaption}" />
                <StackPanel Margin="0,16,8,0" Orientation="Horizontal">
                    <Ellipse Width="16"
                             Height="16"
                             Fill="{Binding ConnectionStatus,
                                            Converter={StaticResource ConnectionDisplayBackground}}" />
                    <TextBlock Margin="8,0,0,0" VerticalAlignment="Center">

                        <TextBlock.Text>
                            <MultiBinding Converter="{StaticResource ConnectionDisplayText}">
                                <Binding Path="ConnectionStatus" />
                                <Binding Path="GameStatus" />
                            </MultiBinding>
                        </TextBlock.Text>

                    </TextBlock>
                </StackPanel>
            </StackPanel>
        </Grid>



        <StackPanel Margin="0,0,0,16" Visibility="{Binding ConnectionStatus, Converter={StaticResource DisconnectPanelVisibility}}">

            <Button Margin="8,0"
                    Command="{Binding DisconnectFromServer}"
                    Content="{Binding DisconnectFromServerButtonsCaptions}" />

        </StackPanel>


        <Grid>
            <Grid.Visibility>
                <MultiBinding Converter="{StaticResource CreateGamePanelVisibility}">
                    <Binding Path="ConnectionStatus" />
                    <Binding Path="GameStatus" />
                </MultiBinding>
            </Grid.Visibility>
			
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="16" />
                <RowDefinition />
                <RowDefinition Height="8" />
                <RowDefinition />
            </Grid.RowDefinitions>
			
            <StackPanel Grid.Row="0">
                <TextBlock Margin="0,0,0,8"
                           Style="{StaticResource MaterialDesignSubheadingTextBlock}"
                           Text="{Binding NewGameNamePromt}" />
                <TextBox materialDesign:HintAssist.Hint="{Binding NewGameNameHint}" 
						 Text="{Binding NewGameName, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" >
					<i:Interaction.Behaviors>
						<commandExecutingBehaviors:ExecuteCommandOnEnter Command="{Binding CreateGame}"/>
					</i:Interaction.Behaviors>
					
				</TextBox>
                <Button Margin="8"
{'fraction_non_alphanumeric': 0.1106014712245781, 'fraction_numerical': 0.013154478580700995, 'mean_word_length': 2.133405639913232, 'pattern_counts': {'":': 0, '<': 147, '<?xml version=': 0, '>': 145, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 20}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3113001', 'n_tokens_mistral': 3133, 'n_tokens_neox': 2764, 'n_words': 362}