Your Last About Dialogの紹介
Windows Phoneのアプリケーションを作る上でアプリケーションの作者や使用しているライブラリなどを記載したAboutページを作ることがよくあります。
このAboutページを簡単に作れるようにしたのが「Your Last About Dialog」です。Aboutページにはだいたい同じ事を載せることが多いので、それをライブラリ化してXMLに設定を記述するだけで自動でAboutダイアログを作成してくれます。
使い方
- CodePlexからダウンロード
- ライブラリを参照に追加
- 設定ファイルの編集
- プログラムの呼び出し
- 注意
1.CodePlexからダウンロード
まずはCodePlexからファイルをダウンロードします。ダウンロードページへ移動
Downloadをクリックしてファイルをダウンロードします。
3.設定ファイルの編集
「YourLastAboutDialog.dll」はプロジェクトの「Content.About/Data.xml」を参照するので、プロジェクトにContent/About/Data.xmlを作成します。
Data.xmlのひな形は解凍したファイルの「sample/Data.xml」にあるのでこちらを参考にしてください。
試しに私の方で簡単に設定してみたのがこちらです。*1
<?xml version="1.0" encoding="utf-8" ?> <About> <!-- The App element allows you to override the values that are extracted from the WMAppManifest.xml file automatically --> <!-- The AdditionalNotes attribute has no equivalent in the WMAppManifest.xml; you can only define its content here --> <!-- Explicitly set any of the attributes to an empty string to remove it (including its label) from the dialog --> <App Title="カウントダウン" Author="kabakiyo" Publisher="kabakiyo" Description="いつまでにやるか忘れないために日付をカウントダウンします" AdditionalNotes="タスク・記念日などさまざまな用途に使用できます。また、逆に過ぎ去った日をカウントすることで、生まれてから経った日や結婚してから何日経ったかが分かります。人によって使い方はさまざま。" /> <Items> <!-- Create a MainItem entry to configure the front page --> <!-- The Titel attribute defines the title of the pivot item --> <!-- The Label (and review buttong content) attributes can override the default values to what you like, and also help with localization --> <!-- By default, the "Buy this app!" button is only shown when the app runs in trial mode (more on trial mode and how to configure YLAD accordingly here: http://ylad.codeplex.com/documentation). Explicitly set the button contents to an empty string to override the default behavior, and remove the buttons from the page. --> <MainItem Title="about" AppAuthorLabel="by" AppDescriptionLabel="詳細:" AppPublisherLabel="発行者:" AppVersionLabel="バージョン:" AppAdditionalNotesLabel="備考:" AppReviewButtonContent="レビューする!" AppBuyButtonContent="Buy this app!"> </MainItem> </Items> </About>
このように設定すると次のようなAboutページが生成されます。
4.プログラムの呼び出し
Navigateメソッドで呼び出します。
private void Abuut_Click(object sender, EventArgs e) { NavigationService.Navigate(new Uri("/YourLastAboutDialog;component/AboutPage.xaml", UriKind.Relative)); }
5.注意
ページの色を設定できないので独自の色を使いたい場合には向いていません。そのときはデフォルトのまま使うか、あきらめて独自で作成したほうがよいと思います。
詳しい使い方についてはCodePlexの「Your Last About Dialog」を参照してください。
*1:もっと詳細に設定できます