<commit_before>﻿<Page
    x:Class="UnofficialSamsungRemote.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UnofficialSamsungRemote"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    mc:Ignorable="d"
    d:DesignWidth="480"
    d:DesignHeight="768"
    MaxHeight="768"
    MaxWidth="480"
    MinWidth="480"
    MinHeight="768"
    Loaded="Page_Loaded">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Pivot Title="Unofficial Samsung remote" Name="MainPivot" SelectionChanged="MainPivot_SelectionChanged">
            <PivotItem Header="tv list">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <ListBox x:Name="TvListBox" Margin="0,0,0,0" ItemsSource="{Binding TvItems}" Grid.Row="0" Tapped="TvListBox_Tapped">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="TV.png" Width="62" Height="62" VerticalAlignment="Top"/>
                                    <StackPanel Width="432" Height="78">
                                        <TextBlock Text="{Binding TvName}" TextWrapping="NoWrap" FontSize="{ThemeResource TextStyleExtraLargeFontSize}"/>
                                        <StackPanel Orientation="Horizontal" Margin="12,-6,12,0">
                                            <TextBlock Text="{Binding TvAddress}" TextWrapping="NoWrap" Margin="0,0,0,0"/>
                                            <TextBlock Text=":" Margin="3,-2,3,0"/>
                                            <TextBlock Text="{Binding Port}" TextWrapping="NoWrap" Margin="0,0,0,0"/>
                                        </StackPanel>
                                    </StackPanel>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </PivotItem>
            <PivotItem Header="numpad">
                <Grid>
                    <Image HorizontalAlignment="Left" VerticalAlignment="Top"
                           Source="Images/rack.png"  Margin="0,70,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,22,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_01.png" MyKey="KEY_1"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,22,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_02.png" MyKey="KEY_2"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,22,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_03.png" MyKey="KEY_3"/>

                    <Image HorizontalAlignment="Left" VerticalAlignment="Top"
                           Source="Images/rack.png" Margin="0,220,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,172,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_04.png" MyKey="KEY_4"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,172,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_05.png" MyKey="KEY_5"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,172,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_06.png" MyKey="KEY_6"/>

                    <Image HorizontalAlignment="Center" VerticalAlignment="Top"
                           Source="Images/rack.png" Margin="0,370,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,317,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_07.png" MyKey="KEY_7"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,317,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_08.png" MyKey="KEY_8"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,317,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_09.png" MyKey="KEY_9"/>

                    <Image HorizontalAlignment="Center" VerticalAlignment="Top"
                           Source="Images/rack.png" Margin="0,520,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,470,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_minus.png" MyKey="KEY_PLUS100"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,470,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_00.png" MyKey="KEY_0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,470,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_ch.png" MyKey="KEY_PRECH"/>
                </Grid>
            </PivotItem>
            <PivotItem Header="navigation">
                <Grid>
                    <!-- menu controls -->
                    <Image VerticalAlignment="Top" Margin="0,0,0,0" Source="Images/direction_bg.png" />
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Width="164" Height="108"
                        ImageLocation="Images/direction_content.png" MyKey="KEY_CONTENTS"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Center" Width="156" Height="108"
                        ImageLocation="Images/direction_menu.png" MyKey="KEY_MENU"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Right" Width="164" Height="108"
                        ImageLocation="Images/direction_internet.png" MyKey="KEY_RSS"/>

                    <!-- tools/info/return/exit -->
                    <Rectangle Fill="#66000000" RadiusX="10" RadiusY="10" Width="450" Height="120" Margin="3,122,0,0"
                               VerticalAlignment="Top" HorizontalAlignment="Left"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_tools.png" MyKey="KEY_TOOLS"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="118,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_info.png" MyKey="KEY_INFO"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="232,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_return.png" MyKey="KEY_RETURN"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="344,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_exit.png" MyKey="KEY_EXIT"/>

                    <!-- navigation controls -->
                    <Image HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,250,0,0" Width="449" Height="321"
                           Source="Images/nav_bg.png"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="147,352,0,0" Width="160" Height="114"
                        ImageLocation="Images/key_keyboard.png" MyKey="KEY_ENTER"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="147,466,0,0" Width="160" Height="120"
                        ImageLocation="Images/key_down.png" MyKey="KEY_DOWN" AllowRepeats="True"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="307,348,0,0" Width="154" Height="124"
                        ImageLocation="Images/key_right.png" MyKey="KEY_RIGHT" AllowRepeats="True"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-7,347,0,0" Width="154" Height="124"
                        ImageLocation="Images/key_left.png" MyKey="KEY_LEFT" AllowRepeats="True"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="147,232,0,0" Width="160" Height="120"
                        ImageLocation="Images/key_up.png" MyKey="KEY_UP" AllowRepeats="True"/>

                    <!-- misc controls -->
                    <local:TvKeyControl Margin="25,53,327,57" Width="103" Height="64"
                        ImageLocation="Images/qwerty_btn.png" MyKey="KEY_INVALID" OnKeyPressed="OnQwertyButtonPressed"/>
                    <local:TvKeyControl Margin="25,487,327,57" Width="103" Height="64"
                        ImageLocation="Images/source_btn.png" MyKey="KEY_SOURCE"/>
                    <local:TvKeyControl Margin="329,53,29,59" Width="103" Height="64"
                        ImageLocation="Images/3d_btn.png" MyKey="KEY_PANNEL_CHDOWN"/>
                    <local:TvKeyControl Margin="329,490,29,59" Width="98" Height="58"
                        ImageLocation="Images/power_btn.png" MyKey="KEY_POWEROFF" OnKeyPressed="OnPowerButtonPressed"/>
                </Grid>
            </PivotItem>
            <PivotItem Header="control">
                <Grid>
                    <!-- play/pause controls -->
                    <!-- row 1 -->
                    <Image HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,70,0,0"
                            Source="Images/rack.png"/>
                    <local:TvKeyControl Margin="27,10,305,487" Width="124" Height="110"
                            ImageLocation="Images/playcontrol_rew.png" MyKey="KEY_WHEEL_LEFT"/>
                    <local:TvKeyControl Margin="166,10,166,487" Width="124" Height="110"
                            ImageLocation="Images/playcontrol_pause.png" MyKey="KEY_PAUSE"/>
                    <local:TvKeyControl Margin="303,10,29,487" Width="124" Height="110"
                            ImageLocation="Images/playcontrol_ff.png" MyKey="KEY_WHEEL_RIGHT"/>
                    <!-- row 2 -->
                    <Image HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,190,0,0"
                            Source="Images/rack.png"/>
                    <local:TvKeyControl Margin="27,130,305,367" Height="110" Width="124"
                            ImageLocation="Images/playcontrol_rec.png" MyKey="KEY_REC"/>
                    <local:TvKeyControl Margin="166,130,166,367" Height="110" Width="124"
                            ImageLocation="Images/playcontrol_play.png" MyKey="KEY_PLAY"/>
                    <local:TvKeyControl Margin="303,130,29,367" Height="110" Width="124"
                            ImageLocation="Images/playcontrol_stop.png" MyKey="KEY_STOP"/><commit_msg>Fixed some elements that somehow got misaligned<commit_after>﻿<Page
    x:Class="UnofficialSamsungRemote.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:UnofficialSamsungRemote"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"
    mc:Ignorable="d"
    d:DesignWidth="480"
    d:DesignHeight="768"
    MaxHeight="768"
    MaxWidth="480"
    MinWidth="480"
    MinHeight="768"
    Loaded="Page_Loaded">

    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
        <Pivot Title="Unofficial Samsung remote" Name="MainPivot" SelectionChanged="MainPivot_SelectionChanged">
            <PivotItem Header="tv list">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>

                    <ListBox x:Name="TvListBox" Margin="0,0,0,0" ItemsSource="{Binding TvItems}" Grid.Row="0" Tapped="TvListBox_Tapped">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal">
                                    <Image Source="TV.png" Width="62" Height="62" VerticalAlignment="Top"/>
                                    <StackPanel Width="432" Height="78">
                                        <TextBlock Text="{Binding TvName}" TextWrapping="NoWrap" FontSize="{ThemeResource TextStyleExtraLargeFontSize}"/>
                                        <StackPanel Orientation="Horizontal" Margin="12,-6,12,0">
                                            <TextBlock Text="{Binding TvAddress}" TextWrapping="NoWrap" Margin="0,0,0,0"/>
                                            <TextBlock Text=":" Margin="3,-2,3,0"/>
                                            <TextBlock Text="{Binding Port}" TextWrapping="NoWrap" Margin="0,0,0,0"/>
                                        </StackPanel>
                                    </StackPanel>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                </Grid>
            </PivotItem>
            <PivotItem Header="numpad">
                <Grid>
                    <Image HorizontalAlignment="Left" VerticalAlignment="Top"
                           Source="Images/rack.png"  Margin="0,70,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,22,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_01.png" MyKey="KEY_1"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,22,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_02.png" MyKey="KEY_2"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,22,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_03.png" MyKey="KEY_3"/>

                    <Image HorizontalAlignment="Left" VerticalAlignment="Top"
                           Source="Images/rack.png" Margin="0,220,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,172,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_04.png" MyKey="KEY_4"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,172,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_05.png" MyKey="KEY_5"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,172,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_06.png" MyKey="KEY_6"/>

                    <Image HorizontalAlignment="Center" VerticalAlignment="Top"
                           Source="Images/rack.png" Margin="0,370,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,317,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_07.png" MyKey="KEY_7"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,317,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_08.png" MyKey="KEY_8"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,317,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_09.png" MyKey="KEY_9"/>

                    <Image HorizontalAlignment="Center" VerticalAlignment="Top"
                           Source="Images/rack.png" Margin="0,520,0,0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="46,470,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_minus.png" MyKey="KEY_PLUS100"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="190,470,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_00.png" MyKey="KEY_0"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="327,470,0,0" Width="90" Height="120"
                           ImageLocation="Images/keypad_ch.png" MyKey="KEY_PRECH"/>
                </Grid>
            </PivotItem>
            <PivotItem Header="navigation">
                <Grid>
                    <!-- menu controls -->
                    <Image VerticalAlignment="Top" Margin="0,0,0,0" Source="Images/direction_bg.png" />
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Width="164" Height="108"
                        ImageLocation="Images/direction_content.png" MyKey="KEY_CONTENTS"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Center" Width="156" Height="108"
                        ImageLocation="Images/direction_menu.png" MyKey="KEY_MENU"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Right" Width="164" Height="108"
                        ImageLocation="Images/direction_internet.png" MyKey="KEY_RSS"/>

                    <!-- tools/info/return/exit -->
                    <Rectangle Fill="#66000000" RadiusX="10" RadiusY="10" Width="450" Height="120" Margin="3,122,0,0"
                               VerticalAlignment="Top" HorizontalAlignment="Left"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="6,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_tools.png" MyKey="KEY_TOOLS"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="118,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_info.png" MyKey="KEY_INFO"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="232,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_return.png" MyKey="KEY_RETURN"/>
                    <local:TvKeyControl VerticalAlignment="Top" HorizontalAlignment="Left" Margin="344,122,0,0" Width="120" Height="120"
                        ImageLocation="Images/direction_exit.png" MyKey="KEY_EXIT"/>

                    <!-- navigation controls -->
                    <Image HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,250,0,0" Width="449" Height="321"
                           Source="Images/nav_bg.png"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="147,352,0,0" Width="160" Height="114"
                        ImageLocation="Images/key_keyboard.png" MyKey="KEY_ENTER"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="147,466,0,0" Width="160" Height="120"
                        ImageLocation="Images/key_down.png" MyKey="KEY_DOWN" AllowRepeats="True"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="307,348,0,0" Width="154" Height="124"
                        ImageLocation="Images/key_right.png" MyKey="KEY_RIGHT" AllowRepeats="True"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="-7,347,0,0" Width="154" Height="124"
                        ImageLocation="Images/key_left.png" MyKey="KEY_LEFT" AllowRepeats="True"/>
                    <local:TvKeyControl HorizontalAlignment="Left" VerticalAlignment="Top" Margin="147,232,0,0" Width="160" Height="120"
                        ImageLocation="Images/key_up.png" MyKey="KEY_UP" AllowRepeats="True"/>

                    <!-- misc controls -->
                    <local:TvKeyControl Margin="26,278,327,331" Width="103" Height="64"
                        ImageLocation="Images/qwerty_btn.png" MyKey="KEY_INVALID" OnKeyPressed="OnQwertyButtonPressed"/>
                    <local:TvKeyControl Margin="26,485,327,124" Width="103" Height="64"
                        ImageLocation="Images/source_btn.png" MyKey="KEY_SOURCE"/>
                    <local:TvKeyControl Margin="329,278,24,331" Width="103" Height="64"
                        ImageLocation="Images/3d_btn.png" MyKey="KEY_PANNEL_CHDOWN"/>
                    <local:TvKeyControl Margin="329,488,24,127" Width="98" Height="58"
                        ImageLocation="Images/power_btn.png" MyKey="KEY_POWEROFF" OnKeyPressed="OnPowerButtonPressed"/>
                </Grid>
            </PivotItem>
            <PivotItem Header="control">
                <Grid>
                    <!-- play/pause controls -->
                    <!-- row 1 -->
                    <Image HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,70,0,0"
                            Source="Images/rack.png"/>
                    <local:TvKeyControl Margin="27,16,305,547" Width="124" Height="110"
                            ImageLocation="Images/playcontrol_rew.png" MyKey="KEY_WHEEL_LEFT"/>
                    <local:TvKeyControl Margin="166,16,166,547" Width="124" Height="110"
                            ImageLocation="Images/playcontrol_pause.png" MyKey="KEY_PAUSE"/>
                    <local:TvKeyControl Margin="303,16,29,547" Width="124" Height="110"
                            ImageLocation="Images/playcontrol_ff.png" MyKey="KEY_WHEEL_RIGHT"/>
                    <!-- row 2 -->
                    <Image HorizontalAlignment="Left" VerticalAlignment="Top" Margin="0,190,0,0"
                            Source="Images/rack.png"/>
                    <local:TvKeyControl Margin="27,136,305,427" Height="110" Width="124"
                            ImageLocation="Images/playcontrol_rec.png" MyKey="KEY_REC"/>
                    <local:TvKeyControl Margin="166,136,166,427" Height="110" Width="124"
                            ImageLocation="Images/playcontrol_play.png" MyKey="KEY_PLAY"/>
                    <local:TvKeyControl Margin="303,136,29,427" Height="110" Width="124"
                            ImageLocation="Images/playcontrol_stop.png" MyKey="KEY_STOP"/>
{'fraction_non_alphanumeric': 0.13315521847797984, 'fraction_numerical': 0.05395156425062484, 'mean_word_length': 2.149273985615416, 'pattern_counts': {'":': 2, '<': 179, '<?xml version=': 0, '>': 179, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5164362', 'n_tokens_mistral': 7314, 'n_tokens_neox': 6091, 'n_words': 837}