西西軟件園多重安全檢測(cè)下載網(wǎng)站、值得信賴的軟件下載站!
軟件
軟件
文章
搜索

首頁(yè)編程開(kāi)發(fā)其它知識(shí) → Windows Phone 7中英文互翻譯源碼下載

Windows Phone 7中英文互翻譯源碼下載

相關(guān)軟件相關(guān)文章發(fā)表評(píng)論 來(lái)源:西西整理時(shí)間:2013/6/23 10:05:02字體大。A-A+

作者:西西點(diǎn)擊:26次評(píng)論:0次標(biāo)簽: WindowsPhone7

  • 類型:電子教程大。11.6M語(yǔ)言:中文 評(píng)分:7.5
  • 標(biāo)簽:
立即下載

本文為大家提供了Windows Phone 7中英文互翻譯的源碼下載,希望對(duì)正在學(xué)習(xí)或者剛剛接觸Windows Phone開(kāi)發(fā)的網(wǎng)友們有所啟發(fā)和幫助。

XAML:


<phone:PhoneApplicationPage 

    x:Class="WebCPServic.MainPage" 

    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 

    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 

    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" 

    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" 

    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 

    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 

    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768" 

    FontFamily="{StaticResource PhoneFontFamilyNormal}" 

    FontSize="{StaticResource PhoneFontSizeNormal}" 

    Foreground="{StaticResource PhoneForegroundBrush}" 

    SupportedOrientations="Portrait" Orientation="Portrait" 

    shell:SystemTray.IsVisible="True"> 

    <!--LayoutRoot 是包含所有頁(yè)面內(nèi)容的根網(wǎng)格--> 

    <Grid x:Name="LayoutRoot" Background="Transparent"> 

        <Grid.RowDefinitions> 

            <RowDefinition Height="Auto"/> 

            <RowDefinition Height="*"/> 

        </Grid.RowDefinitions> 

        <!--TitlePanel 包含應(yīng)用程序的名稱和頁(yè)標(biāo)題--> 

        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28"> 

            <TextBlock x:Name="ApplicationTitle" Text="WP7開(kāi)發(fā)者:dev.ruanman.net" Style="{StaticResource PhoneTextNormalStyle}"/> 

            <TextBlock x:Name="PageTitle" Text="中英文翻譯" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/> 

        </StackPanel> 

        <!--ContentPanel - 在此處放置其他內(nèi)容--> 

        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> 

            <TextBlock Height="49" HorizontalAlignment="Left" Margin="12,66,0,0" Name="des" Text="請(qǐng)輸入你需要查詢的英文或中文" VerticalAlignment="Top" Width="284" /> 

            <TextBox Height="72" HorizontalAlignment="Left" Margin="6,106,0,0" Name="No" Text="dev.ruanman.net" VerticalAlignment="Top" Width="415" /> 

            <Button Content="查詢" Height="72" HorizontalAlignment="Left" Margin="12,184,0,0" Name="search" VerticalAlignment="Top" Width="247" Click="search_Click" /> 

            <TextBlock Height="auto"  TextAlignment="Center" HorizontalAlignment="Center" Margin="6,510,0,0" Name="hugwp" Text="www.ruanman.net" VerticalAlignment="Top" Width="444" /> 

            <ListBox Height="242" HorizontalAlignment="Left" Margin="9,262,0,0" Name="listBox1" VerticalAlignment="Top" Width="441" /> 

        </Grid> 

    </Grid> 

    <!--演示 ApplicationBar 用法的示例代碼--> 

    <!--<phone:PhoneApplicationPage.ApplicationBar> 

        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"> 

            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="按鈕 1"/> 

            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="按鈕 2"/> 

            <shell:ApplicationBar.MenuItems> 

                <shell:ApplicationBarMenuItem Text="菜單項(xiàng) 1"/> 

                <shell:ApplicationBarMenuItem Text="菜單項(xiàng) 2"/> 

            </shell:ApplicationBar.MenuItems> 

        </shell:ApplicationBar> 

    </phone:PhoneApplicationPage.ApplicationBar>--> 

</phone:PhoneApplicationPage>  

C#:


private void search_Click(object sender, RoutedEventArgs e) 

       { 

           //實(shí)例化一個(gè)web service代理的對(duì)象 

           EnglishChineseReference.EnglishChineseSoapClient proxy = new EnglishChineseReference.EnglishChineseSoapClient(); 

           //getMobileCodeInfo方法調(diào)用結(jié)束之后 觸發(fā)的事件 

           proxy.TranslatorStringCompleted += new EventHandler<EnglishChineseReference.TranslatorStringCompletedEventArgs>(proxy_GetIcpInfoByDomainCompleted); 

           //將調(diào)用信息包括方法名和參數(shù)加入到soap消息中通過(guò)http傳送給web service服務(wù)端    

           //這里對(duì)應(yīng)的是調(diào)用了web service的getMobileCodeInfo方法 

           proxy.TranslatorStringAsync(No.Text, ""); 

       } 

       void proxy_GetIcpInfoByDomainCompleted(object sender, EnglishChineseReference.TranslatorStringCompletedEventArgs e) 

       { 

           if (e.Error == null) 

           { 

               try 

               { 

                   this.listBox1.ItemsSource = e.Result; 

               } 

               catch (Exception) 

               { 

                   MessageBox.Show("網(wǎng)絡(luò)出現(xiàn)問(wèn)題,或者是手機(jī)號(hào)碼錯(cuò)誤"); 

               } 

           } 

           else 

           { 

               MessageBox.Show("網(wǎng)絡(luò)出現(xiàn)問(wèn)題,或者是手機(jī)號(hào)碼錯(cuò)誤"); 

           } 

       }  

Windows Phone 7中英文互翻譯源碼下載:http://pan.baidu.com/share/link?shareid=1182989426&uk=85241834

    相關(guān)評(píng)論

    閱讀本文后您有什么感想? 已有人給出評(píng)價(jià)!

    • 8 喜歡喜歡
    • 3 頂
    • 1 難過(guò)難過(guò)
    • 5 囧
    • 3 圍觀圍觀
    • 2 無(wú)聊無(wú)聊

    熱門評(píng)論

    最新評(píng)論

    發(fā)表評(píng)論 查看所有評(píng)論(0)

    昵稱:
    表情: 高興 可 汗 我不要 害羞 好 下下下 送花 屎 親親
    字?jǐn)?shù): 0/500 (您的評(píng)論需要經(jīng)過(guò)審核才能顯示)