www.pudn.com > Proximity-sample.zip > PeerFinderScenario.xaml, change:2012-06-01,size:4577b


<!-- 
//********************************************************* 
// 
// Copyright (c) Microsoft. All rights reserved. 
// This code is licensed under the Microsoft Public License. 
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF 
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY 
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR 
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT. 
// 
//********************************************************* 
--> 
 
<common:LayoutAwarePage 
    x:Class="ProximityCPP.PeerFinderScenario" 
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:local="using:$rootsnamespace$" 
    xmlns:common="using:ProximityCPP.Common" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    mc:Ignorable="d"> 
 
    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top"> 
        <Grid.RowDefinitions> 
            <RowDefinition Height="Auto"/> 
            <RowDefinition Height="*"/> 
        </Grid.RowDefinitions> 
        <Grid x:Name="Input" Grid.Row="0"> 
            <Grid.RowDefinitions> 
                <RowDefinition Height="Auto"/> 
                <RowDefinition Height="Auto"/> 
                <RowDefinition Height="Auto"/> 
                <RowDefinition Height="*"/> 
            </Grid.RowDefinitions> 
            <TextBlock x:Name="InputTextBlock1"  TextWrapping="Wrap" Grid.Row="0" Style="{StaticResource BasicTextStyle}" HorizontalAlignment="Left" > 
                When running this sample on two PCs with Proximity devices installed, you can use the PeerFinder to find peers to  
                connect to using a StreamSocket.  
                Click 'Advertise' (on both PCs) and then enter proximity with the other PC.  
                The PeerFinder will link the PCs and provide a StreamSocket so the two PCs can communicate. 
            </TextBlock> 
            <TextBlock x:Name="InputTextBlock2"  TextWrapping="Wrap" Grid.Row="1" Style="{StaticResource BasicTextStyle}" HorizontalAlignment="Left" > 
                Alternatively, click 'Browse for Peers' to find nearby peers using WIFI direct technology and  
                connect to them using "Connect To a Peer" button. The peer application will respond to the incoming connection request and  
                show the "Accept Connection Request" button. Click that button to accept the connection.  
                When connection is complete click "Send Message" to send a message typed in the text box. 
            </TextBlock> 
            <StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Row="2"> 
                <Button x:Name="PeerFinder_StartFindingPeersButton" Content="Advertise" Visibility="Collapsed" Margin="0,0,10,0"/> 
                <Button x:Name="PeerFinder_BrowsePeersButton" Content="Browse for Peers" Visibility="Collapsed" Margin="0,0,10,0"/> 
                <Button x:Name="PeerFinder_ConnectButton" Content="Connect To a Peer" Visibility="Collapsed" Margin="0,0,10,0"/> 
                <ListBox x:Name="PeerFinder_FoundPeersList" Visibility="Collapsed"> 
                </ListBox> 
            </StackPanel> 
            <StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Row="3"> 
                <Button x:Name="PeerFinder_AcceptButton" Content="Accept Connection Request" Visibility="Collapsed" Margin="0,0,10,0"/> 
                <Button x:Name="PeerFinder_SendButton" Content="Send Message" Visibility="Collapsed" Margin="0,0,10,0"/> 
                <TextBox x:Name="PeerFinder_MessageBox" Visibility="Collapsed" Width="400" Margin="0,0,10,0"/> 
            </StackPanel> 
        </Grid> 
 
        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1"> 
            <TextBlock x:Name="PeerFinderOutputText" Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" /> 
        </Grid> 
         
        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts --> 
        <VisualStateManager.VisualStateGroups> 
            <VisualStateGroup> 
                <VisualState x:Name="FullScreenLandscape"/> 
                <VisualState x:Name="Filled"/> 
                <VisualState x:Name="FullScreenPortrait"/> 
                <VisualState x:Name="Snapped"/> 
            </VisualStateGroup> 
        </VisualStateManager.VisualStateGroups> 
    </Grid> 
 
</common:LayoutAwarePage>