Advertisement
Vadorequest

MainPage.xaml.cs

Sep 30th, 2013
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 6.15 KB | None | 0 0
  1. <phone:PhoneApplicationPage
  2.     x:Class="SocketsTest.MainPage"
  3.     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4.     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5.     xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  6.     xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  7.     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  8.     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  9.     mc:Ignorable="d"
  10.     FontFamily="{StaticResource PhoneFontFamilyNormal}"
  11.     FontSize="{StaticResource PhoneFontSizeNormal}"
  12.     Foreground="{StaticResource PhoneForegroundBrush}"
  13.     SupportedOrientations="Portrait" Orientation="Portrait"
  14.     shell:SystemTray.IsVisible="True">
  15.  
  16.     <!--LayoutRoot is the root grid where all page content is placed-->
  17.     <Grid x:Name="LayoutRoot" Background="Transparent">
  18.         <Grid.RowDefinitions>
  19.             <RowDefinition Height="Auto"/>
  20.             <RowDefinition Height="*"/>
  21.         </Grid.RowDefinitions>
  22.  
  23.         <!-- LOCALIZATION NOTE:
  24.             To localize the displayed strings copy their values to appropriately named
  25.             keys in the app's neutral language resource file (AppResources.resx) then
  26.            replace the hard-coded text value between the attributes' quotation marks
  27.             with the binding clause whose path points to that string name.
  28.  
  29.             For example:
  30.  
  31.                 Text="{Binding Path=LocalizedResources.ApplicationTitle, Source={StaticResource LocalizedStrings}}"
  32.  
  33.             This binding points to the template's string resource named "ApplicationTitle".
  34.  
  35.            Adding supported languages in the Project Properties tab will create a
  36.            new resx file per language that can carry the translated values of your
  37.            UI strings. The binding in these examples will cause the value of the
  38.            attributes to be drawn from the .resx file that matches the
  39.            CurrentUICulture of the app at run time.
  40.         -->
  41.  
  42.        <!--TitlePanel contains the name of the application and page title-->
  43.        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
  44.            <TextBlock Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
  45.            <TextBlock Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
  46.        </StackPanel>
  47.  
  48.        <!--ContentPanel - place additional content here-->
  49.        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,-8,12,8">
  50.            <Grid.ColumnDefinitions>
  51.                <ColumnDefinition Width="Auto"/>
  52.                <!-- Fit to content -->
  53.                <ColumnDefinition Width="Auto"/>
  54.                <!-- Fit to content -->
  55.                <ColumnDefinition Width="Auto"/>
  56.                <!-- Fit to content -->
  57.                <ColumnDefinition Width="*"/>
  58.                <!-- Take up remaining space -->
  59.            </Grid.ColumnDefinitions>
  60.            <Grid.RowDefinitions>
  61.                <RowDefinition Height="Auto"/>
  62.                <!-- Fit to content -->
  63.                <RowDefinition Height="Auto"/>
  64.                <!-- Fit to content -->
  65.                <RowDefinition Height="Auto"/>
  66.                <!-- Fit to content -->
  67.                <RowDefinition Height="*"/>
  68.                <!-- Take up remaining space -->
  69.            </Grid.RowDefinitions>
  70.  
  71.            <!-- Grid Row 0: Remote Host Input Field >-->
  72.            <TextBlock Grid.Row="0" Grid.Column="0" Text="Host Name:"  
  73.               VerticalAlignment="Center" HorizontalAlignment="Center"
  74.               FontSize="{StaticResource PhoneFontSizeNormal}" />
  75.            <TextBox x:Name="txtRemoteHost" Grid.Row="0" Grid.Column="1"  Height="70" Width="200"
  76.     VerticalAlignment="Top" HorizontalAlignment="Left"
  77.     FontSize="{StaticResource PhoneFontSizeNormal}" Text="137.135.176.144" TextChanged="txtRemoteHost_TextChanged"  />
  78.  
  79.            <!-- Grid Row 1: Echo >-->
  80.            <!-- TextBlock for Echo command label-->
  81.            <TextBlock Grid.Row="1" Grid.Column="0" Text="Text To Echo:"
  82.               VerticalAlignment="Center" HorizontalAlignment="Center"
  83.               FontSize="{StaticResource PhoneFontSizeNormal}" />
  84.  
  85.            <!-- TextBox for Echo command text input-->
  86.            <TextBox x:Name="txtInput" Grid.Row="1" Grid.Column="1" Height="70" Width="200"  
  87.             VerticalAlignment="Top" HorizontalAlignment="Left"
  88.             FontSize="{StaticResource PhoneFontSizeNormal}" Text="connection" />
  89.  
  90.            <!-- Button to the right of the input textbox for the Echo command >-->
  91.            <Button x:Name="btnEcho" Grid.Row="1" Grid.Column="2" Height="70"  Width="120"
  92.            Content="Echo"
  93.            FontSize="{StaticResource PhoneFontSizeNormal}" Click="btnEcho_Click"/>
  94.  
  95.            <!-- Grid Row 2: Quote of the Day-->
  96.            <!-- Button for the Quote command >-->
  97.            <Button x:Name="btnGetQuote" Grid.Row="2" Grid.ColumnSpan="4" Height="70"
  98.            Content="Get Quote of the Day"
  99.            FontSize="{StaticResource PhoneFontSizeNormal}" Click="btnGetQuote_Click"/>
  100.  
  101.            <!-- Grid Row 3: Output-->
  102.            <!-- Output TextBox named 'txtOutput' >-->
  103.            <TextBox x:Name="txtOutput" Grid.Row="3" Grid.ColumnSpan="4" Background="Black" BorderBrush="Green"
  104.             AcceptsReturn="False" Foreground="LightGray" FontFamily="Courier New"  
  105.             IsHitTestVisible="False" FontSize="{StaticResource PhoneFontSizeSmall}" TextWrapping="Wrap" />
  106.        </Grid>
  107.  
  108.        <!--Uncomment to see an alignment grid to help ensure your controls are
  109.            aligned on common boundaries.  The image has a top margin of -32px to
  110.            account for the System Tray. Set this to 0 (or remove the margin altogether)
  111.            if the System Tray is hidden.
  112.  
  113.            Before shipping remove this XAML and the image itself.-->
  114.        <!--<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />-->
  115.    </Grid>
  116.  
  117. </phone:PhoneApplicationPage>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement