Windows Phoneアプリ制作からマーケットプレイス公開までを完全ガイド! 9

facebookへの投稿設定ページの実装

facebookへの投稿設定ページの実装

俳句の入力処理を実装する前に、facebookへの投稿設定機能を実装します。

ソリューションエクスプローラーのプロジェクト名を右クリックして表示される「追加/新しい項目」でPortrait Pageを追加します。名前は、Preferences.xamlとします。

投稿設定ページのデザイン(Preferences.xaml)

まず、MainPage.xaml同様、LayoutRootのGridのBackgroundに”#FFFFFFFA”を指定し、StackPanel部分をコメントアウトしておきます。

ツールボックスからImageコントロールを1個、TextBlockコントロールを4個、TextBoxコントロールを2個、Buttonコントロールを2個、ドラッグしてレイアウトします。

これらのコントロールに名前を付けて(図3)、Image のSourceには、アプリの小さいロゴを指定します。この小さいロゴは、他のページについても同じ場所にレイアウトします。

 図3:投稿設定ページにコントロールをレイアウトする(クリックで拡大)

図3のようにレイアウトした各コントロールのプロパティを調整し、完成したデザイン・コードは、リスト4になります。

リスト4 投稿設定ページのデザイン・コード(Preferences.xaml)

<phone:PhoneApplicationPage 
  x:Class="DailyHaiku_in_Japanese.Preferences"
  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"
  FontFamily="{StaticResource PhoneFontFamilyNormal}"
  FontSize="{StaticResource PhoneFontSizeNormal}"
  Foreground="{StaticResource PhoneForegroundBrush}"
  SupportedOrientations="Portrait" Orientation="Portrait"
  mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480"
  shell:SystemTray.IsVisible="True" Language="ja-JP">

  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot" Background="#FFFFFFFA">
    <Grid.RowDefinitions>
      <RowDefinition Height="Auto"/>
      <RowDefinition Height="*"/>
    </Grid.RowDefinitions>
 
    <!--ContentPanel - place additional content here-->
    <Grid x:Name="ContentPanel" Grid.Row="1" Margin="15,0,15,0">
      <Image Height="60" HorizontalAlignment="Left" Margin="0,15,0,0" Name="HaikuLogo60px" Stretch="Fill" VerticalAlignment="Top" Width="60" Source="/DailyHaiku_in_Japanese;component/Image/HaikuLogo60px.png" />
      <TextBlock Height="50" HorizontalAlignment="Left" Margin="83,22,0,0" Name="Settings" Text="facebookへの投稿設定" VerticalAlignment="Top" Width="344" Foreground="#FF00004B" FontSize="32" TextAlignment="Center" />
 
      <TextBlock FontSize="22" Margin="0,100,0,592" Foreground="#FF333333" TextWrapping="Wrap">facebookへの投稿機能をお使いになるには、この設定が必要です。</TextBlock>
    
      <TextBlock FontSize="22" Margin="0,180,0,551" Foreground="#FF333333">facebook投稿時のタイトル</TextBlock>
      <TextBox HorizontalAlignment="Left" Margin="-9,210,0,311" Name="LinkTitleText" Text="一日一句" Width="468" BorderBrush="#FF00004B" Foreground="#FF333333" BorderThickness="1" Height="75" VerticalAlignment="Top" Padding="5" FontSize="24" />
      <TextBlock FontSize="22" Margin="0,300,0,0" Foreground="#FF333333" Height="66" VerticalAlignment="Top">タイトルからのリンク先のアドレス<LineBreak/>(句会のWebサイトやブログなどのURI)</TextBlock>
      <TextBox HorizontalAlignment="Left" Margin="-9,360,0,218" Name="LinkURIText" Text="http://www." Width="468" BorderBrush="#FF00004B" Foreground="#FF333333" BorderThickness="1" Height="75" VerticalAlignment="Top" Padding="5" FontSize="24" />
      <Button Content="投稿を設定" Style="{StaticResource SetPreferencesButtonStyle}"  Height="100" HorizontalAlignment="Left" Margin="100,450,0,0" Name="SetPreferencesButton" VerticalAlignment="Top" Width="100" Background="#FF00004B" IsEnabled="True" />
      <Button Content="投稿しない" Style="{StaticResource DelPreferencesButtonStyle}"  Height="100" HorizontalAlignment="Left" Margin="250,450,0,0" Name="DelPreferencesButton" VerticalAlignment="Top" Width="100" Background="Gainsboro" IsEnabled="True" Foreground="#FF00004B" BorderBrush="#FF00004B" BorderThickness="1" />
 
      <TextBlock FontSize="22" Margin="0,600,0,128" Foreground="#FF333333">※この設定は、いつでも変更できます。</TextBlock>
    </Grid>
  </Grid>
</phone:PhoneApplicationPage>

このページでレイアウトしたButtonコントロールのスタイル設定については、リスト5 のコードをApp.xaml内の要素の子として追加します。

リスト5  App.xaml内に追加する、「設定保存」「投稿不要」ボタンのスタイル設定(App.xaml)

    <Style x:Key="SetPreferencesButtonStyle" TargetType="Button">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="Button">
            <Grid>
              <Image x:Name="SetPreferencesButtonImage" Source="/DailyHaiku_in_Japanese;component/Image/SetPreferencesButton.png" Stretch="Fill"/>
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>
    
    <Style x:Key="DelPreferencesButtonStyle" TargetType="Button">
      <Setter Property="Template">
        <Setter.Value>
          <ControlTemplate TargetType="Button">
            <Grid>
              <Image x:Name="DelPreferencesButtonImage" Source="/DailyHaiku_in_Japanese;component/Image/DelPreferencesButton.png" Stretch="Fill"/>
            </Grid>
          </ControlTemplate>
        </Setter.Value>
      </Setter>
    </Style>

投稿設定ページのロジック(Preferences.xaml.vb)

この投稿設定ページでは、リスト6のようなXML形式の投稿設定ファイルを生成して、「DailyHaiku_Preferences」フォルダ内に「MyPreferences.xml」というファイル名で保存します。

設定が変更された時は、要素を追加し、「投稿不要」ボタンがタップされた時には、この設定ファイルを削除します。

このようなXMLデータの処理にLINQ to XML を使うため、「プロジェクト/参照の追加」からSystem.Xml.Linq を追加しておきます。 

リスト6  facebookへの投稿設定ファイル(MyPreferences.xml)の構造

<?xml version="1.0" encoding="utf-8"?>
<Preferences>
  <facebook>
    <Title>リンク先タイトル(句会の名称など)</Title>
    <LinkUri>リンク先URI(句会のWebサイトなど)</LinkUri>
  </facebook>
  ~<facebook>要素繰り返し~
</Preferences>

このページの処理は次のとおりです(リスト7)。

まず、ローカルストレージに設定ファイルを保存するためにSystem.IO.IsolatedStorage名前空間を、XMLデータを処理するためにSystem.Xml.Linq名前空間をインポートしておきます。

(1)設定ページがロードされた時の処理

この設定ページがロードされた時、設定ファイルの保存先となる「DailyHaiku_Preferences」フォルダがなければ生成しておきます。設定ファイルは、このフォルダ内に「MyPreferences.xml」というファイル名で保存させるようになります。
既に設定ファイルがある場合は、LINQ to XMLを用いて、前掲リスト6にある

要素と<linkuri>要素を取得して、TextBox内に表示しておきます。 <h4>(2)「設定保存」ボタンがタップされた時の処理</h4> <p>「設定保存」ボタンがタップされた時、入力ボックス内のデータをそれぞれ変数に代入しておきます。<br> リンク先URIのデータについては大まかな検証を行い、正しくない場合は入力ボックスの背景色を黄色にして注意を促します。入力されていない場合も、メッセージを表示します。<br> リンク先のタイトルが入力されている場合は、設定ファイルの生成処理を実行します。設定ファイルが存在しない場合は新規生成し、既にある場合は<facebook>要素を生成して追加します。<br> タイトルが入力されていない場合は、メッセージを表示します。</facebook></p> <h4>(3)「投稿不要」ボタンがタップされた時の処理</h4> <p>「投稿不要」ボタンがタップされた時、既存の設定ファイルがある場合は、これを削除します。削除できたら、リンク先のタイトルとURIをデフォルトの「一日一句」と「http://www.」に戻しておきます。</p> <h4>リスト7 投稿設定ページのロジック・コード(Preferences.xaml.vb)</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs">Option Strict On Imports System.IO.IsolatedStorage Imports System.IO Imports System.Xml.Linq Partial Public Class Preferences Inherits PhoneApplicationPage Public Sub New() InitializeComponent() End Sub '●投稿の可否に関わらず使う変数 Dim Storage_Pre As IsolatedStorageFile Dim FilePath_Pre As String </code></pre> <h4>(1)設定ページがロードされた時の処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub Preferences_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded Storage_Pre = IsolatedStorageFile.GetUserStoreForApplication '●「DailyHaiku_Preferences」フォルダがなければ生成する If Storage_Pre.DirectoryExists("DailyHaiku_Preferences") = False Then Storage_Pre.CreateDirectory("DailyHaiku_Preferences") End If '●設定ファイルは、「DailyHaiku_Preferences」フォルダ内の「MyPreferences.xml」とする FilePath_Pre = Path.Combine("DailyHaiku_Preferences", "MyPreferences.xml") '●設定ファイルがあれば、facebook要素のTitle要素とLinkUri要素を取得、TextBox内に表示 If Storage_Pre.FileExists(FilePath_Pre) = True Then Dim MyStream_Pre As IsolatedStorageFileStream = Storage_Pre.OpenFile(FilePath_Pre, FileMode.Open, FileAccess.Read) Dim Reader_Pre As StreamReader = New StreamReader(MyStream_Pre, System.Text.Encoding.UTF8) Dim ReadXmldoc_Pre As String = Reader_Pre.ReadToEnd Dim ItemDoc_Pre As XDocument = XDocument.Parse(ReadXmldoc_Pre) Reader_Pre.Close() MyStream_Pre.Close() Dim MyDataQuery_Pre As IEnumerable(Of XElement) = From c In ItemDoc_Pre.Descendants("facebook") Select c For Each MyResult_Pre In MyDataQuery_Pre LinkTitleText.Text = MyResult_Pre.<Title>.Value LinkURIText.Text = MyResult_Pre.<LinkUri>.Value Next End If End Sub </code></pre> <h4>(2)「設定保存」ボタンがタップされた時の処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub SetPreferencesButton_Tap(sender As System.Object, e As System.Windows.Input.GestureEventArgs) Handles SetPreferencesButton.Tap '●入力ボックス内データを、生成するXMLのテキストとする Dim LinkTitle As String = LinkTitleText.Text Dim LinkUri As String = LinkURIText.Text '●入力ボックス内データの検証。Uriの形式が正しくなければ、入力ボックスの背景色を黄色にして注意を促す If LinkUri <> String.Empty Then If System.Text.RegularExpressions.Regex.IsMatch(LinkUri, "(ht|f)tp(s?)\:\/\/([\w-]+\.)+[\w-]+(/[\w- ./?%&=]*)?", System.Text.RegularExpressions.RegexOptions.IgnoreCase) Then LinkURIText.Background = New SolidColorBrush(Colors.White) Else MessageBox.Show("正しいURIが指定されているかどうか確認してください。") LinkURIText.Background = New SolidColorBrush(Colors.Yellow) Exit Sub End If Else MessageBox.Show("投稿機能をご利用になるには、リンク先アドレスを入力する必要があります。") Exit Sub End If '●設定ファイルの生成。既存ファイルがない場合は新規生成し、既にある場合はfacebook要素を追加していく。 '●俳句の保存時には、最後のfacebook要素の内容を、最新設定として取得して、投稿する。 If LinkTitle <> String.Empty Then Try If Storage_Pre.FileExists(FilePath_Pre) = False Then Dim Xmldoc_Pre As XDocument = <?xml version="1.0" encoding="utf-8"?> <Preferences> <facebook> <Title><%= LinkTitle %></Title> <LinkUri><%= LinkUri %></LinkUri> </facebook> </Preferences> Using MyStream_Pre As IsolatedStorageFileStream = New IsolatedStorageFileStream(FilePath_Pre, FileMode.Create, FileAccess.Write, Storage_Pre) Xmldoc_Pre.Save(MyStream_Pre) MessageBox.Show("俳句保存時にfacebookに投稿できるようになりました。") End Using Else Dim AddStream_Pre As IsolatedStorageFileStream = Storage_Pre.OpenFile(FilePath_Pre, FileMode.Open, FileAccess.Read) Dim Reader_Pre As StreamReader = New StreamReader(AddStream_Pre) Dim ReadXmldoc_Pre As String = Reader_Pre.ReadToEnd Dim AddDoc_Pre As XElement = XElement.Parse(ReadXmldoc_Pre) Dim AddXml_Pre As XElement = <facebook> <Title><%= LinkTitle %></Title> <LinkUri><%= LinkUri %></LinkUri> </facebook> AddDoc_Pre.Add(AddXml_Pre) AddStream_Pre.Dispose() Using Stream_Pre As IsolatedStorageFileStream = New IsolatedStorageFileStream(FilePath_Pre, FileMode.Create, FileAccess.Write, Storage_Pre) If Storage_Pre.FileExists(FilePath_Pre) = True Then AddDoc_Pre.Save(Stream_Pre) Reader_Pre.Dispose() MessageBox.Show("facebookへの投稿方法を設定しました。") End If End Using End If Catch Exit Sub End Try Else '●必須のタイトルが空の場合は、メッセージを表示 MessageBox.Show("投稿機能をご利用になるには、タイトルとリンク先のアドレスの両方が必要です。") Exit Sub End If End Sub </code></pre> <h4>(3)「投稿不要」ボタンがタップされた時の処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub DelPreferencesButton_Tap(sender As System.Object, e As System.Windows.Input.GestureEventArgs) Handles DelPreferencesButton.Tap '●設定ファイルを削除。既存設定ファイルがある場合は、フォルダは残したままファイルを削除する If Storage_Pre.DirectoryExists("DailyHaiku_Preferences") = True And Storage_Pre.FileExists(FilePath_Pre) = True Then Dim MyStream_Pre As IsolatedStorageFileStream = Storage_Pre.OpenFile(FilePath_Pre, FileMode.Open, FileAccess.Read) Using Reader_Pre As StreamReader = New StreamReader(MyStream_Pre, System.Text.Encoding.UTF8) Dim DeleteDoc_Pre As String = Reader_Pre.ReadToEnd Dim DelXml_Pre As XElement = XElement.Parse(DeleteDoc_Pre) MyStream_Pre.Close() End Using Storage_Pre.DeleteFile(FilePath_Pre) LinkTitleText.Text = "一日一句" LinkURIText.Text = "http://www." MessageBox.Show("facebookへの投稿設定情報を削除しました。") Else MessageBox.Show("投稿情報は設定されていません。") End If End Sub End Class </code></pre> <!--pagebreak--> <h2>入力ページの実装</h2> <h3>入力ページのデザイン(CreateHaiku.xaml)</h3> <p>今度は、入力ページを作成します。ソリューションエクスプローラーのプロジェクト名を右クリックして表示される「追加/新しい項目」でPortrait Pageを追加します。名前は、CreateHaiku.xamlとします。LayoutRootのGridのBackgroundに” #FFFFFFFA”を指定し、StackPanel部分をコメントアウトします。</p> <p>ツールボックスから、今回解説する、季語検索、俳句の入力、翻訳、保存、facebookへの投稿の各機能に用いるコントロールを、図4のようにレイアウトします。</p> <p>このページには、<a href="http://thinkit.co.jp/story/2012/04/27/3521" target="_blank">前回</a>説明したとおり、「一覧」ボタンがタップされた時に、俳句を表示する年月の選択ボックスを重ねて表示します。その選択ボックスは、Canvasの中にレイアウトして、表示と非表示を切り替えます。これは俳句が詠まれた後の処理であるので、次回に解説します。</p> <table cellspacing="10" style="width: 636px;"> <tbody> <tr> <td width="204"><a href="/sites/default/files/articles/352504.png" target="_blank"> <picture> <source srcset="/sites/default/files/styles/picturize_mobile_1x/public/articles/352504.png.avif 1x, /sites/default/files/styles/picturize_mobile_2x/public/articles/352504.png.avif 2x" media="(max-width: 480px)" type="image/avif" width="480" height="303"/> <source srcset="/sites/default/files/styles/picturize_normal_1x/public/articles/352504.png.avif 1x" media="(min-width: 480px)" type="image/avif" width="600" height="379"/> <source srcset="/sites/default/files/styles/picturize_mobile_1x/public/articles/352504.png.webp 1x, /sites/default/files/styles/picturize_mobile_2x/public/articles/352504.png.webp 2x" media="(max-width: 480px)" type="image/webp" width="480" height="303"/> <source srcset="/sites/default/files/styles/picturize_normal_1x/public/articles/352504.png.webp 1x" media="(min-width: 480px)" type="image/webp" width="600" height="379"/> <source srcset="/sites/default/files/styles/picturize_normal_1x/public/articles/352504.png 1x" media="(min-width: 480px)" type="image/png" width="600" height="379"/> <source srcset="/sites/default/files/styles/picturize_mobile_1x/public/articles/352504.png 1x, /sites/default/files/styles/picturize_mobile_2x/public/articles/352504.png 2x" media="(max-width: 480px)" type="image/png" width="480" height="303"/> <img style="width:200px;" class="picturize-processed picturize-automatic picturize lazyload-auto lazyload-processed" width="600" height="379" src="/sites/default/files/styles/picturize_base/public/articles/352504.png" alt=" " loading="lazy" typeof="foaf:Image" decoding="async"> </picture> </a></td> <td><strong><span style="font-size: 12px;color: rgb(255, 140, 0);">図4:入力ページに、入力・保存用のコントロールをレイアウトする(クリックで拡大)</span></strong></td> </tr> </tbody> </table> <p>各コントロールのマージン等のプロパティを調整し、完成したデザイン・コードは、リスト8のようになります。</p> <h4>リスト8 入力ページのデザイン・コード(createHaiku.xaml)</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"><phone:PhoneApplicationPage x:Class="DailyHaiku_in_Japanese.CreateHaiku" 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" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" mc:Ignorable="d" d:DesignHeight="768" d:DesignWidth="480" shell:SystemTray.IsVisible="True" Language="ja-JP"> <!--■ここに俳句の一覧表示のためのファイル・リスト用のコードを追加します。次回に解説します--> <!--LayoutRoot is the root grid where all page content is placed--> <Grid x:Name="LayoutRoot" Background="#FFFFFFFA"> <Grid.RowDefinitions> <RowDefinition Height="Auto"/> <RowDefinition Height="*"/> </Grid.RowDefinitions> <!--ContentPanel - place additional content here--> <Grid x:Name="ContentPanel" Grid.Row="1" Margin="15,0,15,0"> <!--■俳句入力画面--> <!--共通ロゴ--> <Image Height="60" HorizontalAlignment="Left" Margin="0,15,0,0" Name="HaikuLogo60px" Stretch="Fill" VerticalAlignment="Top" Width="60" Source="/DailyHaiku_in_Japanese;component/Image/HaikuLogo60px.png" /> <!--年月日表示--> <TextBlock Height="50" HorizontalAlignment="Left" Margin="100,22,0,0" Name="ShowDate" Text="" VerticalAlignment="Top" Width="260" Foreground="#FF00004B" FontSize="32" TextAlignment="Center" /> <!--入力項目名--> <Image Height="21" HorizontalAlignment="Left" Margin="0,100,0,0" Name="RubyImage" Stretch="Fill" VerticalAlignment="Top" Width="233" Source="/DailyHaiku_in_Japanese;component/Image/ruby.png" /> <Image Height="21" HorizontalAlignment="Left" Margin="0,233,0,0" Name="JPNHaikuImage" Stretch="Fill" VerticalAlignment="Top" Width="175" Source="/DailyHaiku_in_Japanese;component/Image/haiku.png" /> <Image Height="21" HorizontalAlignment="Left" Margin="0,468,0,0" Name="EnglishHaikuImage" Stretch="Fill" VerticalAlignment="Top" Width="86" Source="/DailyHaiku_in_Japanese;component/Image/EnglishHaikupng.png" /> <!--入力ボックスの外枠--> <Rectangle Height="95" HorizontalAlignment="Left" Margin="0,127,0,0" Name="RubyBoxBack" Stroke="#FF00004B" StrokeThickness="2" VerticalAlignment="Top" Width="450" Fill="White" /> <Rectangle Height="135" HorizontalAlignment="Left" Margin="1,260,0,0" Name="JpnKuBoxBack" Stroke="#FF00004B" StrokeThickness="4" VerticalAlignment="Top" Width="448" Fill="White" /> <Rectangle Height="135" HorizontalAlignment="Left" Margin="0,495,0,0" Name="EngKuBoxBack" Stroke="#FF00004B" StrokeThickness="2" VerticalAlignment="Top" Width="450" Fill="White" /> <!--入力ボックス--> <TextBox Height="95" HorizontalAlignment="Left" Margin="0,127,0,0" Name="RubyBox" Text="" VerticalAlignment="Top" Width="450" TextWrapping="Wrap" AcceptsReturn="True" Padding="0" FontSize="22" BorderBrush="{x:Null}" Background="White" /> <TextBox Height="135" HorizontalAlignment="Left" Margin="0,260,0,0" Name="JpnKuBox" Text="" VerticalAlignment="Top" Width="450" TextWrapping="Wrap" AcceptsReturn="True" Padding="0" FontSize="24" BorderBrush="{x:Null}" Background="White" /> <TextBox Height="135" HorizontalAlignment="Left" Margin="0,495,0,0" Name="EngKuBox" Text="" VerticalAlignment="Top" Width="450" TextWrapping="Wrap" AcceptsReturn="True" Padding="0" FontSize="24" BorderBrush="{x:Null}" Background="White" /> <!--翻訳ボタン--> <Button Content="翻訳" Height="80" HorizontalAlignment="Left" Margin="127,405,0,0" Name="TranslateButton" VerticalAlignment="Top" Width="80" Style="{StaticResource TranslateButtonStyle}" /> <Button Content="取消" Height="80" HorizontalAlignment="Left" Margin="242,405,0,0" Name="ClearButton" VerticalAlignment="Top" Width="80" Style="{StaticResource TranslateResetButtonStyle}" /> <!--季語検索--> <Image Height="100" HorizontalAlignment="Left" Margin="40,650,0,0" Name="SearchKigoBack" Stretch="Fill" VerticalAlignment="Top" Width="100" Source="/DailyHaiku_in_Japanese;component/Image/SearchKigoBack.png" /> <TextBlock Height="90" HorizontalAlignment="Left" Margin="50,650,0,0" Name="SearchKigoMonthName" VerticalAlignment="Top" Width="80" FontSize="72" Opacity="0.7" FontWeight="Bold" Foreground="#FF4D4DA7" TextAlignment="Center" /> <Image Height="100" HorizontalAlignment="Left" Margin="40,650,0,0" Name="SearchKigo" Stretch="Fill" VerticalAlignment="Top" Width="100" Source="/DailyHaiku_in_Japanese;component/Image/SearchKigoButton.png" /> <!--保存、一覧ボタン--> <Image Height="100" HorizontalAlignment="Left" Margin="175,650,0,0" Name="SaveButton" Stretch="Fill" VerticalAlignment="Top" Width="100" Source="/DailyHaiku_in_Japanese;component/Image/SaveButton.png" /> <Button Height="100" Style="{StaticResource ShowHaikuButtonStyle}" HorizontalAlignment="Left" Margin="310,650,0,0" Name="ShowHaikuButton" VerticalAlignment="Top" Width="100" IsEnabled="False" /> <!--■俳句の一覧表示のための、ファイル・リストのウィンドウを追加します。次回に解説します--> </Grid> </Grid> </phone:PhoneApplicationPage> </code></pre> <p>この中で、「一覧」ボタンは、ImageコントロールではなくButtonコントロールを使います。このボタンは俳句が記録されていない場合は機能させないので、IsEnabledにFalseを指定する必要があるからです。また、「翻訳」「取消」についても、ここではButtonコントロールを使っています。</p> <p>これらのボタンのスタイルは、App.xaml内に指定します。リスト9のように、<application.resources>要素の子として<style>要素を追加します。</style></application.resources></p> <h4>リスト9  App.xaml内に追加する、「英語」「投稿」「一覧」ボタンのスタイル設定(App.xaml)</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> <Style x:Key="TranslateButtonStyle" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <Image x:Name="TranslateButtonImage" Source="/DailyHaiku_in_Japanese;component/Image/TranslateButton.png" Stretch="Fill"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="TranslateResetButtonStyle" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <Image x:Name="TranslateResetButtonImage" Source="/DailyHaiku_in_Japanese;component/Image/TranslateResetButton.png" Stretch="Fill"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> <Style x:Key="ShowHaikuButtonStyle" TargetType="Button"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="Button"> <Grid> <Image x:Name="ShowHaikuButtonImage" Source="/DailyHaiku_in_Japanese;component/Image/readHaikuButton.png" Stretch="Fill"/> </Grid> </ControlTemplate> </Setter.Value> </Setter> </Style> </code></pre> <h3>俳句ファイルの構造の再確認</h3> <p>この入力ページでは、入力された俳句データをもとに、リスト10のような構造のXMLドキュメントを生成します。そして、ローカルストレージに「DailyHaiku_in_Japanese_Data」フォルダを生成し、その中に「2012年1月.xml」というように、年月を名前とするファイルを保存します。</p> <h4>リスト10 生成・保存するXMLドキュメント(○○年○○月.xml)の構造</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"><?xml version="1.0" encoding="utf-8"?> <俳句集 年月="2012年1月"> <俳句 創作年月日="2012年1月22日" 登録日時="2012/01/22/03:24:07"> <句> 改行された俳句 </句> <ルビ>ルビやコメントなど</ルビ> <英語句> 改行された英語俳句 </英語句> </俳句> ~句の数だけ<俳句>要素、繰り返し~ </俳句集> </code></pre> <h3>入力ページのロジック(CreateHaiku.xaml.vb)</h3> <p>では、入力ページの処理を記述していきます(リスト11)。</p> <p>このページでは、季語のbing検索のために、Microsoft.Phone.Tasksもインポートしておきます。</p> <h3>Microsoft Translatorの使用について</h3> <p>翻訳機能にはMicrosoft Translatorを使用するため、<a href="http://thinkit.co.jp/story/2012/04/11/3510?page=0,2" target="_blank">第7回</a>で取得したApplication IDを定数変数として宣言しておきます。</p> <p>ダウンロードしたプロジェクトファイルを利用する場合は、Const MyAppID As String = "ユーザーがそれぞれ取得したID"の部分を、必ず書き換えてください。</p> <h4>値の初期化</h4> <p>これから生成することになる、ルビ、日本語句、英語句、"登録日時"属性の値(日英共通でyyyy/MM/dd/HH/mm/ss)、"創作年月日"属性の値(○年○月○日)を初期化しておきます。</p> <p>また、季語検索用キー、タイトル部分の年月、ルート要素の"年月"属性の値(○年○月)を初期化しておきます。このルート要素の"年月"属性の値は、拡張子.xmlを付加して、ファイル名として使います。</p> <p>facebook投稿の可否および投稿に必要なデータを代入する変数を宣言します。投稿可の場合は変数MyPostにTrue、投稿しない場合Falseが入ります。</p> <h4>(1)入力ページがロードされた時の処理</h4> <p>タイトル部分に本日の日付を表示します。ただし、月日をまたいでの創作があるため、保存時には別途日時を取得することにします。</p> <p><a href="http://thinkit.co.jp/story/2012/04/04/3502?page=0,2" target="_blank">第5回</a>の図7で解説したように、このバージョンでも、季語検索ボタンの2番目のレイヤーにロード時の月を表示します。</p> <p>月別俳句ファイルの保存先とする「DailyHaiku_in_Japanese_Data」フォルダがなければ生成しておきます。<br> 指定フォルダ内に俳句ファイルがなければ「一覧」ボタンは使用不可とし、1個でもあれば使用可とします。</p> <p>facebook投稿用の設定ファイルがあれば、最新の設定データを取得して、投稿可否の判別用変数MyPostにTrueを代入しておきます。</p> <p>また、LINQ to XMLでfacebook要素を処理して、最新のTitle要素とLinkUri要素の内容を取得しておきます。設定ファイルがない場合は、投稿判別変数MyPostにFalseを代入しておきます。</p> <h4>(2)「英語」ボタンがタップされた時の処理</h4> <p>「英語」ボタンがタップされた時には、Microsoft Translatorによる翻訳処理を実行します。</p> <p>日本語句を取得して、bing翻訳を実行します。<a href="http://thinkit.co.jp/story/2012/04/27/3521" target="_blank">第8回</a>の図2で解説したとおり、ネットワークに接続されていない場合に備えて、エラー処理を書いておきます。</p> <h4>(3)「取消」ボタンがタップされた時の処理</h4> <p>「取消」ボタンがタップされた時は、英語俳句入力ボックス内を空にします。</p> <h4>(4)季語検索の処理</h4> <p>「季語検索」ボタンに表示されている月を指定して、「俳句 季語 月名」をキーワードに季語を検索します。</p> <h4>(5) 月別俳句ファイルの生成・保存処理、facebookへの投稿処理の実行</h4> <p>月別の俳句ファイルを生成して保存し、投稿設定がなされている場合、保存処理に引き続き、facebookへの投稿処理を実行する処理です。</p> <p>入力ボックス内のデータを各々変数に代入し、必須項目の「日本語句」が空ではない(入力済み)の場合、日時を取得します。ファイル名に使用する年月を取得、アクセスするフォルダ名(DailyHaiku_in_Japanese_Data)とファイル名(○年○月.xml)を指定します。</p> <p>また、年月日を取得し、創作年月日とします。このデータは、「一覧」表示で、右下に表示する際にも使います。</p> <p>ファイルが存在しない場合は新規生成、存在する場合はデータを追加して、前掲のリスト10の構造のXMLファイルを作成して、保存します。</p> <p>XMLファイル保存後、変数MyPostに「True」が代入されている場合は、facebookへの投稿処理のPostToFacebookプロシジャを実行します。MyPostにFalseが代入されている場合は、第8回の図4のとおり、投稿処理は実行しません。</p> <p>保存と投稿処理実行後、各入力ボックスを空にしておきます。また、「一覧」ボタンを使用可能にします。</p> <h4>(6)facebookへの投稿処理</h4> <p>英語句がある場合は、投稿表示を分かりやすくするためスミ付き括弧で囲みます(<a href="http://thinkit.co.jp/story/2012/04/27/3521?page=0,1" target="_blank">第8回</a>の図12参照)。<br> ShareLinkTaskを使って投稿を実装します。</p> <p>以上のXMLデータ生成、保存、投稿処理を終えた後、保存済み俳句のデータを選択して表示する処理に移ります。この処理については次回に解説します。</p> <h4>リスト11 入力ページの、季語検索・入力・翻訳・保存・投稿処理のロジック・コード(Preferences.xaml.vb)</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs">Option Strict On Imports System.IO.IsolatedStorage Imports System.IO Imports Microsoft.Phone.Tasks Imports System.Xml.Linq '俳句の一覧表示のための、ファイル・リスト取得コード(次回解説) 'Public Class ShowYearMonth 'Property 年月 As String 'End Class Partial Public Class CreateHaiku Inherits PhoneApplicationPage Public Sub New() InitializeComponent() End Sub '■■季語検索、俳句の入力、翻訳、保存、投稿処理 '●Microsoft TranslatorのユーザーID Const MyAppID As String = "ユーザーがそれぞれ取得したID" '●俳句データを初期化 Dim MyRuby As String = String.Empty Dim MyKuJapanese As String = String.Empty Dim MyKuEnglish As String = String.Empty Dim MyRecordDateTime As String = String.Empty '登録日時属性値。日英共通でyyyy/MM/dd/HH/mm/ss Dim MyComposeHaikuDate As String = String.Empty '創作年月日属性値。○年○月○日 '●季語検索用キーを初期化 Dim SearchKigoMonth As String = String.Empty '●年月表示を初期化 Dim CreateHaikuDate As String = String.Empty 'MainPageロード時のタイトル部分の年月表示用 '●属性値として記録する年月を初期化 Dim ComposeHaikuMonth As String = String.Empty 'ルート要素「俳句集」の属性値。○年○月 '●ファイル名として使う年月を初期化 Dim CreateHaikuMonth As String = String.Empty 'ComposeHaikuMonthに拡張子.xmlを付加したもの '●facebook投稿用データを宣言 Dim MyPost As String '投稿可の場合True、投稿しない場合False Dim MyTitleText As String Dim MyLinkText As String </code></pre> <h4>(1)入力ページがロードされた時の処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub CreateHaiku_Loaded(sender As Object, e As System.Windows.RoutedEventArgs) Handles MyBase.Loaded '●タイトル部分に本日の日付を表示。保存時には別途日時を取得する。 CreateHaikuDate = CStr(DateTime.Now.Year) & "年" & CStr(DateTime.Now.Month) & "月" & CStr(DateTime.Now.Day) & "日" ShowDate.Text = CreateHaikuDate '●季語検索ボタンの2レイヤー目にロード時の月を表示 SearchKigoMonth = CStr(DateTime.Now.Month) SearchKigoMonthName.Text = SearchKigoMonth '●月別俳句ファイルの保存先とする「DailyHaiku_in_Japanese_Data」フォルダがなければ生成しておく Dim HaikuStorage As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication If HaikuStorage.DirectoryExists("DailyHaiku_in_Japanese_Data") = False Then HaikuStorage.CreateDirectory("DailyHaiku_in_Japanese_Data") End If '●ロード時には俳句ファイルが存在しても月別リストは非表示 MyHaikuList.Visibility = Windows.Visibility.Collapsed '●指定フォルダ内に俳句ファイルがなければ「一覧」ボタンは使用不可とし、1個でもあれば使用可とする Dim HaikuFilePath As String = Path.Combine("DailyHaiku_in_Japanese_Data", "*.xml") Dim HaikuFileList() As String = HaikuStorage.GetFileNames(HaikuFilePath) If HaikuFileList.Length <= 0 Then ShowHaikuButton.Opacity = 0.3 ShowHaikuButton.IsEnabled = False Else ShowHaikuButton.Opacity = 1.0 ShowHaikuButton.IsEnabled = True End If '●facebook投稿用設定ファイルの読み込み。このファイルはPreferences.xaml.vbで生成される。 Dim Storage_Pre As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication Dim FilePath_Pre As String = Path.Combine("DailyHaiku_Preferences", "MyPreferences.xml") '●設定ファイルがあれば、最新の設定データを取得して、投稿可否の判別用変数MyPostにTrueを代入 If Storage_Pre.FileExists(FilePath_Pre) = True Then Dim MyStream_Pre As IsolatedStorageFileStream = Storage_Pre.OpenFile(FilePath_Pre, FileMode.Open, FileAccess.Read) Dim Reader_Pre As StreamReader = New StreamReader(MyStream_Pre, System.Text.Encoding.UTF8) Dim ReadXmldoc_Pre As String = Reader_Pre.ReadToEnd Dim ItemDoc_Pre As XDocument = XDocument.Parse(ReadXmldoc_Pre) Reader_Pre.Close() MyStream_Pre.Close() '●facebook要素を処理して、最後のTitle要素とLinkUri要素の内容を取得、最新の設定データを取得 Dim MyDataQuery_Pre As IEnumerable(Of XElement) = From c In ItemDoc_Pre.Descendants("facebook") Select c For Each MyResult_Pre In MyDataQuery_Pre MyTitleText = MyResult_Pre.<Title>.Value MyLinkText = MyResult_Pre.<LinkUri>.Value Next MyPost = "True" Else '●設定ファイルがなければ、投稿判断用変数MyPostにFalseを代入 MyPost = "False" End If End Sub </code></pre> <h4>(2)「英語」ボタンがタップされた時の処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub TranslateButton_Tap(sender As System.Object, e As System.Windows.Input.GestureEventArgs) Handles TranslateButton.Tap '●日本語句を取得 MyKuJapanese = JpnKuBox.Text If MyKuJapanese = String.Empty Then MessageBox.Show("日本語の俳句を入力してください。") End If Dim MyWebClient As New WebClient Dim MyTranslate As String = String.Format("http://api.microsofttranslator.com/v2/Http.svc/Translate?appId={0}&text={1}&from=ja&to=en", MyAppID, MyKuJapanese) MyWebClient.DownloadStringAsync(New Uri(MyTranslate, UriKind.Absolute)) '●bing翻訳を実行。サーバーからの応答が遅れた場合と、ネットワークに接続されていない場合のエラー処理を書いておく。 AddHandler MyWebClient.DownloadStringCompleted, Sub(resultSender As Object, resultArgs As DownloadStringCompletedEventArgs) Try Dim MyTranslateDoc As XDocument = XDocument.Parse(resultArgs.Result) EngKuBox.Text = MyTranslateDoc.Elements.First.Value Catch MessageBox.Show("ネットワークに接続されていないかタイムアウトの可能性があります。しばらくお待ちのうえ翻訳を再実行するか、日本語俳句のみ保存してください。") Exit Sub End Try End Sub End Sub </code></pre> <h4>(3)「取消」ボタンがタップされた時の処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> '●英語俳句入力ボックス内を空にする Private Sub ClearButton_Tap(sender As System.Object, e As System.Windows.Input.GestureEventArgs) Handles ClearButton.Tap EngKuBox.Text = String.Empty End Sub </code></pre> <h4>(4)季語検索の処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub SearchKigo_Tap_1(sender As System.Object, e As System.Windows.Input.GestureEventArgs) Handles SearchKigo.Tap '●「季語検索」ボタンに表示されている月の季語を検索 Dim MySearchTask As New SearchTask MySearchTask.SearchQuery = "俳句 季語 " & SearchKigoMonth & "月" MySearchTask.Show() End Sub </code></pre> <h4>(5)月別俳句ファイルの生成・保存、facebookへの投稿処理の実行</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub SaveButton_Tap(sender As System.Object, e As System.Windows.Input.GestureEventArgs) Handles SaveButton.Tap '●入力ボックス内のデータを各々変数に代入。英語句とルビが未入力の場合は空データとする MyKuJapanese = JpnKuBox.Text MyKuEnglish = EngKuBox.Text MyRuby = RubyBox.Text '●必須項目の「日本語句」が空ではない(入力済み)の場合の処理 If MyKuJapanese <> String.Empty Then Try '●データの登録日時を取得(次期英語版のために共通化しておく) MyRecordDateTime = DateTime.Now.ToString("yyyy/MM/dd/HH:mm:ss") '●保存先フォルダの生成 Dim HaikuStorage As IsolatedStorageFile = IsolatedStorageFile.GetUserStoreForApplication If HaikuStorage.DirectoryExists("DailyHaiku_in_Japanese_Data") = False Then HaikuStorage.CreateDirectory("DailyHaiku_in_Japanese_Data") End If '●ファイル名に使用する年月を取得、アクセスするフォルダ名とファイル名を指定 ComposeHaikuMonth = CStr(DateTime.Now.Year) & "年" & CStr(DateTime.Now.Month) & "月" CreateHaikuMonth = ComposeHaikuMonth & ".xml" Dim HaikuFilePath As String = Path.Combine("DailyHaiku_in_Japanese_Data", CreateHaikuMonth) '●「一覧」表示で、右下に表示する創作年月日を取得 MyComposeHaikuDate = ComposeHaikuMonth & CStr(DateTime.Now.Day) & "日" '●ファイルが存在しない場合は新規生成、存在する場合はデータを末尾に追加 If HaikuStorage.FileExists(HaikuFilePath) = False Then Dim HaikuXmldoc As XDocument = <?xml version="1.0" encoding="utf-8"?> <俳句集 年月=<%= ComposeHaikuMonth %>> <俳句 創作年月日=<%= MyComposeHaikuDate %> 登録日時=<%= MyRecordDateTime %>> <句><%= MyKuJapanese %></句> <ルビ><%= MyRuby %></ルビ> <英語句><%= MyKuEnglish %></英語句> </俳句> </俳句集> Using HaikuStream As IsolatedStorageFileStream = New IsolatedStorageFileStream(HaikuFilePath, FileMode.Create, FileAccess.Write, HaikuStorage) HaikuXmldoc.Save(HaikuStream) MessageBox.Show("今日の俳句を" & ComposeHaikuMonth & "のファイルに保存しました。") End Using Else Dim HaikuAddStream As IsolatedStorageFileStream = HaikuStorage.OpenFile(HaikuFilePath, FileMode.Open, FileAccess.Read) Dim HaikuReader As StreamReader = New StreamReader(HaikuAddStream) Dim HaikuReadXmldoc As String = HaikuReader.ReadToEnd Dim HaikuAddDoc As XElement = XElement.Parse(HaikuReadXmldoc) Dim HaikuAddXml As XElement = <俳句 創作年月日=<%= MyComposeHaikuDate %> 登録日時=<%= MyRecordDateTime %>> <句><%= MyKuJapanese %></句> <ルビ><%= MyRuby %></ルビ> <英語句><%= MyKuEnglish %></英語句> </俳句> HaikuAddDoc.Add(HaikuAddXml) HaikuAddStream.Dispose() Using HaikuStream As IsolatedStorageFileStream = New IsolatedStorageFileStream(HaikuFilePath, FileMode.Create, FileAccess.Write, HaikuStorage) If HaikuStorage.FileExists(HaikuFilePath) = True Then HaikuAddDoc.Save(HaikuStream) HaikuReader.Dispose() MessageBox.Show("今日の俳句を" & ComposeHaikuMonth & "のファイルに保存しました。") End If End Using End If '●●facebookへの投稿処理の実行判別 '●投稿可の場合の処理。ShareLinkTaskを用いて投稿。 '●投稿しない場合は、MyPostにFalseが代入されているため、この処理はスルーされる If MyPost = "True" Then PostToFacebook() End If '●各入力ボックスを空にし、入力された値を代入する変数を初期化しておく RubyBox.Text = String.Empty JpnKuBox.Text = String.Empty EngKuBox.Text = String.Empty MyRuby = String.Empty MyKuJapanese = String.Empty MyKuEnglish = String.Empty '●俳句ファイルが1個でも生成保存されたら、「一覧」ボタンを有効にする ShowHaikuButton.Opacity = 1.0 ShowHaikuButton.IsEnabled = True Catch Exit Sub End Try Else '●必須の日本語句が空の場合は、メッセージを表示する MessageBox.Show("俳句を入力してください。") Exit Sub End If End Sub </code></pre> <h4>(6)facebookへの投稿処理</h4> <pre class="brush: plain" type="syntaxhighlighter"><code class="hilightjs"> Private Sub PostToFacebook() '●英語句がある場合、投稿表示を分かりやすくするためスミ付き括弧で囲む If MyKuEnglish.Length > 0 Then MyKuEnglish = vbCrLf & "【" & MyKuEnglish & "】" Else MyKuEnglish = String.Empty End If Try Dim MyShareLinkTask As New ShareLinkTask With MyShareLinkTask .Title = MyTitleText .LinkUri = New Uri(MyLinkText, UriKind.Absolute) .Message = MyKuJapanese & vbCrLf & MyKuEnglish .Show() End With Catch MessageBox.Show("ネットワークへの接続状況を確認してください。あるいは「facebookへの投稿設定」で入力したリンク先URIに不備がないか確認してください。") Exit Sub End Try End Sub '■保存済み俳句ファイルの年月リストをListBoxに表示する処理を追加します(次回解説) '■俳句ファイル・リストのウィンドウをタップした時の処理を追加します(次回解説) '■ListBoxから、俳句を閲覧したい月が選択された時の処理を追加します(次回解説) End Class </code></pre> <p>以上で、俳句を作成するまでの処理が完成しました。次回は、俳句が作られた後の、表示と削除の処理について解説します。</p> <p>なお、今回の記事で取り上げた処理の詳細については、過去の記事を参照してください。</p> <h4>【関連リンク】</h4> <h4>データのローカルストレージへの保存</h4> <ul class="type-none" style="font-size:12px;"> <li><a href="http://thinkit.co.jp/story/2011/12/09/2419" target="_blank">Windows Phone Tips集(2)「第4回 入力したデータを分離ストレージに保存し、一覧で表示する」</a></li> </ul> <h4>Microsoft Translator</h4> <ul class="type-none" style="font-size:12px;"> <li><a href="http://thinkit.co.jp/story/2011/08/26/2242" target="_blank">これから始めるWindows Phone プログラミング(基本編)第14回 翻訳された英文の表示と読み上げ</a></li> <li><a href="http://thinkit.co.jp/story/2011/12/26/2622" target="_blank">Windows Phone Tips集(2)第8回 「英文Webの部分翻訳」と「QRコードの生成」のサンプル</a></li> </ul> <h4>ShareStatusTask</h4> <ul class="type-none" style="font-size:12px;"> <li><a href="http://thinkit.co.jp/story/2011/11/15/2331?page=0,1" target="_blank">Windows Phone Tips集 第10回 モーションセンサーとShareStatusTask、MediaPlayerLauncherを使う</a></li> <li><a href="http://thinkit.co.jp/story/2011/11/21/2333" target="_blank">Windows Phone Tips集 第12回 ShareLinkTaskを使ったSNSでのリンク共有とHubTileのサンプル</a></li> </ul> <p>その他、開発に役立つリンク集を紹介します。</p> <dl> <dt>■<a href="http://msdn.microsoft.com/ja-jp/default.aspx" target="_blank" rel="noopener">開発者向け技術情報サイト MSDN</a> </dt> <dd>全ての情報は、ここから。</dd> <dt>■<a href="http://social.msdn.microsoft.com/Forums/ja/wpmarketplaceja/threads" target="_blank" rel="noopener">App Hub / Windows Phone マーケットプレイス Windows Phone フォーラム</a> </dt> <dd>App Hub の利用や Windows Phone マーケットプレイスに関する話題や情報交換の場です。</dd> <dt>■<a href="http://msdn.microsoft.com/ja-jp/hh162048" target="_blank" rel="noopener">UX-TV</a> </dt> <dd>アプリケーション開発に関する情報をエバンジェリストの方々が定期的に発信しています。Windows Phone開発に関する番組が充実しています。</dd> <dt>■<a href="http://www.microsoft.com/ja-jp/windowsphone/" target="_blank" rel="noopener">Windows Phone公式サイト(Microsoft)</a> </dt> <dt>■<a href="http://msdn.microsoft.com/ja-jp/windowsphone/default" target="_blank" rel="noopener">Windows Phone 開発者向け技術情報</a> </dt> <dt>■<a href="http://www.facebook.com/WindowsPhoneJapan" target="_blank" rel="noopener">facebook 公式 Fan Page「Windows Phone Japan」</a> </dt> <dt>■<a href="http://msdn.microsoft.com/ja-jp/windowsphone/gg750754#blog" target="_blank" rel="noopener">Windows Phone 関連ブログ</a> </dt> <dt>■<a href="http://wp-arch.net/" target="_blank" rel="noopener">コミュニティ: Windows Phone Arch</a> </dt> </dl> <p style="font-size:12px; color:#666666;"><リンク先最終アクセス:2012.04></p> <div class="next_page_link" id="next_page_link_auto"><a href="/story/2012/05/01/3525?page=2" class="btn --next-prev next_page_link_auto_bancho_common">入力ページの実装</a></div></linkuri>

この記事をシェアしてください

人気記事トップ10

人気記事ランキングをもっと見る