簡易メモ帳
Simple Notepad
* テキストファイルの編集、保存、読み込み
Edit, Save, Load a text file
* いくつかのコントラクトを装備
Some contracts equipped
[2012/10/21] RTM対応版は code.msdn.microsoft.com で公開しています。
→
http://code.msdn.microsoft.com/windowsapps/bwNotepad-for-Metro-XAMLC-2a84d0ec
※ 以下に掲載してあるコードは Win8CP + VS11beta 用です。製品版ではビルドできません。
[ファイル・アクティベーション]
[File Activation]
* 拡張子 ".txt" の既定のアプリケーションになります。
This becomes the default application for the file-extension ".txt".
* OnFileActivated() @App.xaml.cs
引数には、このプログラムが開くべきファイル名が入っている。
In Argument, the file name is contained which this program should open.
* OnNavigatedTo() @MainPage.xaml.cs
ファイル・アクティベーションのとき、引数の型はActivationKind.Fileです。
At File-Activation, type of the argument is ActivationKind.File.
[共有コントラクト(受け側)]
[Share Contract (receive)]
* 文字列の共有先になります。Readerアプリなどで文字列を選択して、共有チャームを使います。
This becomes a share target of strings. Select strings by the Reader app etc., then use share charm.
* OnShareTargetActivated() @App.xaml.cs
* Activate() @TextShareTargetPage.xaml.cs
* ShareButton_Click() @TextShareTargetPage.xaml.cs
[延長スプラッシュ画面]
[Extended Splash Screen]
* 起動時、ただちにExtendedSplashに切り替えます。
ExtendedSplash is immediately displayed at launching.
もし起動に長時間掛かったとしても、強制終了されません。
So, even if launching process takes longer time, it will not be terminated by a system.
* ShowExtendedSplash() @App.xaml.cs
ExtendedSplash.xaml
[ButtonDisabler]
* Button_Clickイベントハンドラー内で、そのボタンを簡単にdisableにします。
ButtonDisabler class helps you to disable a button easyly in the Button_Click event handler.
* ButtonDisabler.cs
XxxButton_Click() @MainPage.xaml.cs