<?xml version="1.0" encoding="UTF-8" ?><rdf:RDF 
  xmlns="http://purl.org/rss/1.0/"
  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:atom="http://www.w3.org/2005/Atom"
  xmlns:dc="http://purl.org/dc/elements/1.1/"
  xml:lang="ja">
  <channel rdf:about="http://w.atwiki.jp/axis-tec/">
    <title>axis-tech @ ウィキ</title>
    <link>http://w.atwiki.jp/axis-tec/</link>
    <atom:link href="https://w.atwiki.jp/axis-tec/rss10.xml" rel="self" type="application/rss+xml" />
    <atom:link rel="hub" href="https://pubsubhubbub.appspot.com" />
    <description>axis-tech @ ウィキ</description>

    <dc:language>ja</dc:language>
    <dc:date>2009-05-18T12:06:37+09:00</dc:date>
    <utime>1242615997</utime>

    <items>
      <rdf:Seq>
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/24.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/23.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/22.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/21.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/20.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/19.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/18.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/17.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/16.html" />
                <rdf:li rdf:resource="https://w.atwiki.jp/axis-tec/pages/15.html" />
              </rdf:Seq>
    </items>
	
		
    
  </channel>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/24.html">
    <title>開発部/技術/Visual Studio 2008/WPF/画面遷移と値の受け渡し</title>
    <link>https://w.atwiki.jp/axis-tec/pages/24.html</link>
    <description>
      WPFでの画面遷移方法とページ間で値を受け渡す方法について紹介します。

WPFではNavigationServiceクラスを利用して画面遷移を実現します。
画面１⇒画面２という感じに画面遷移するサンプルを作ってみたいと思います。

画面１では画面２に渡す文字列と文字色を入力し、ハイパーリンクをクリックすることで画面２に遷移します。
XAMLはこんな感じです。
#highlight(xml,linenumber){{
&lt;Page x:Class=&quot;TestApplication.NavigationTest1&quot;
    xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    Title=&quot;NavigationTest1&quot; Loaded=&quot;Page_Loaded&quot;&gt;
    &lt;StackPanel&gt;
        &lt;TextBox Name=&quot;txtTest&quot; Width=&quot;150&quot; Height=&quot;24&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;5&quot;&gt;&lt;/TextBox&gt;
        &lt;ComboBox Height=&quot;24&quot; Name=&quot;cboColors&quot; Width=&quot;120&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;5&quot; /&gt;
        &lt;TextBlock Margin=&quot;5&quot;&gt;
            次のページに移動するには&lt;Hyperlink Name=&quot;hlTest&quot; Click=&quot;hlTest_Click&quot;&gt;ここ&lt;/Hyperlink&gt;をクリックしてください。   
        &lt;/TextBlock&gt;
    &lt;/StackPanel&gt;
&lt;/Page&gt;
}}

画面２では画面１より渡された文字列、文字色をTextBlockに設定します。
XAMLはこんな感じ。
#highlight(xml,linenumber){{
&lt;Page x:Class=&quot;TestApplication.NavigationTest2&quot;
        </description>
    <dc:date>2009-05-18T12:06:37+09:00</dc:date>
    <utime>1242615997</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/23.html">
    <title>開発部/技術/Visual Studio 2008/WPF/クラスのプロパティの一覧をComboBoxに設定する</title>
    <link>https://w.atwiki.jp/axis-tec/pages/23.html</link>
    <description>
      いろいろなコントロールのCursorプロパティを動的に変更させたいと思い、Cursorsクラスのプロパティ一覧をコンボボックスに設定しようと考えました。
で、コンボボックスの選択を変更することによりCursorプロパティが動的に変更されたらいいなと思っていたのですが・・・。
思ったより手こずったので、方法をこちらで紹介します。

最終的にできるようになったこととして
-静的クラスの全プロパティを取得し、オブジェクトとして生成できる。
-列挙体の全列挙値を取得できる。
-コンボボックスにプロパティ・列挙値の一覧を設定し、その値から対象のコントロールのプロパティを変更することができる。
-特殊なパターンとして、StringからBrushオブジェクトを生成することができる。
です。

まずはComboBoxに引数のTypeのプロパティをすべて設定するメソッドです。
#highlight(java,linenumber){{
private void SetObjectFromType(ComboBox combo, Type t)
{
    foreach (PropertyInfo info in t.GetProperties())
    {
        combo.Items.Add(info.GetValue(null, null));
    }
}
}}
TypeのGetPropertiesメソッドでそのTypeのすべてのプロパティがPropertyInfoオブジェクトとして取得できます。
PropertyInfoオブジェクトのGetValueメソッドでプロパティのオブジェクトが取得できるので、それをComboBoxのアイテムとして設定しています。
ポイントとして、GetValueメソッドの引数ですが、
|第1引数|プロパティ値が返されるオブジェクト|
|第2引数|インデックス付きプロパティのインデックス値 (省略可能)|
|戻り値|第1引数のプロパティ値|
となっており、実は静的クラスのPropertyInfoからGetValueを呼び出す場合は第1引数はnullでOKなんです。
ここ、気づくのに結構かかっちゃいました・・・。
そうすると晴れて、静的クラスのプロパティが取得できるわけです。
    </description>
    <dc:date>2009-05-18T12:05:48+09:00</dc:date>
    <utime>1242615948</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/22.html">
    <title>開発部/技術/Visual Studio 2008/WPF/駐停車禁止っぽいボタン</title>
    <link>https://w.atwiki.jp/axis-tec/pages/22.html</link>
    <description>
      道路標識の｢駐停車禁止｣っぽいボタンを作ってみた。
Grid部分をTemplate化すれば、いろんなところで使えるかも。
ボタンのサイズは17×17と小さ目を考えているので、大きくして使う人はStrokeThicknessプロパティを大きくする必要があります。
さらに、縦横比1：1という制限つき（＾～＾）
使えないか。。。。？

#highlight(xml,linenumber){{
                &lt;Button Name=&quot;Button2&quot; Height=&quot;17&quot;  Width=&quot;17&quot;&gt;
                    &lt;Button.Template&gt;
                        &lt;ControlTemplate&gt;
                            &lt;Grid&gt;
                                &lt;Grid.ColumnDefinitions&gt;
                                    &lt;ColumnDefinition Width=&quot;20*&quot; /&gt;
                                    &lt;ColumnDefinition Width=&quot;100*&quot; /&gt;
                                    &lt;ColumnDefinition Width=&quot;20*&quot; /&gt;
                                &lt;/Grid.ColumnDefinitions&gt;
                                &lt;Grid.RowDefinitions&gt;
                                    &lt;RowDefinition Height=&quot;20*&quot; /&gt;
                                    &lt;RowDefinition Height=&quot;100*&quot; /&gt;
                                    &lt;RowDefinition Height=&quot;20*&quot; /&gt;
                               </description>
    <dc:date>2009-04-27T16:44:10+09:00</dc:date>
    <utime>1240818250</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/21.html">
    <title>開発部/技術/Visual Studio 2008/Tips/Visual Studio ショートカットキー</title>
    <link>https://w.atwiki.jp/axis-tec/pages/21.html</link>
    <description>
      #ls3

よく使うショートカットキーをまとめました。

|BGCOLOR(blue):COLOR(white):CENTER:ショートカットキー|BGCOLOR(blue):COLOR(white):CENTER:説明|
|Ctrl + Shift + B|ビルド|
|Ctrl + F5|デバッグなしで実行|
|F5|デバッグありで実行|
|Ctrl + K, Ctrl + C|コメントアウト|
|Ctrl + K, Ctrl + U|コメント解除|
|Ctrl + K, Ctrl + D|フォーマット|
|F12|定義へ移動|
|Ctrl + -|１つ前へ戻る|
|F7|デザイナ⇒コードデザイナ（エディタ）の切り替え|
|Shift + F7|コードデザイナ（エディタ）⇒デザイナの切り替え|
|Shift + Alt + Enter|全画面表示|
|Ctrl + Shift + F3|ソリューション全体を検索して結果一覧を表示|




----    </description>
    <dc:date>2009-04-25T13:24:30+09:00</dc:date>
    <utime>1240633470</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/20.html">
    <title>開発部/技術/Visual Studio 2008/Tips</title>
    <link>https://w.atwiki.jp/axis-tec/pages/20.html</link>
    <description>
      #ls3





----    </description>
    <dc:date>2009-04-25T13:04:46+09:00</dc:date>
    <utime>1240632286</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/19.html">
    <title>開発部/技術/Visual Studio 2008/WPF/ガジェットっぽいコントロール/UserControl1.xaml.vb</title>
    <link>https://w.atwiki.jp/axis-tec/pages/19.html</link>
    <description>
      #highlight(vb.net,linenumber){{
Class UserControl1 

    Public Event CntDrag(ByVal sender As Object, 
                    ByVal e As System.Windows.Controls.
                                      Primitives.DragDeltaEventArgs)

    Private Sub Thumb_DragDelta(ByVal sender As System.Object,
                    ByVal e As System.Windows.Controls.
                                      Primitives.DragDeltaEventArgs)

        RaiseEvent CntDrag(Me, e)

    End Sub

    Private Sub Thumb_DragStarted(ByVal sender As System.Object,
                    ByVal e As System.Windows.Controls.
                                      Primitives.DragStartedEventArgs)

        Cursor = Cursors.Hand

    End Sub

    Private Sub Thumb_DragCompleted(ByVal sender As System.Object,
                    ByVal e As System.Windows.Controls.
                                      Primitives.DragCompletedEventArgs)

        Cursor = Cursors.Arrow

    End Sub

    Private Sub Thumb2_D    </description>
    <dc:date>2009-04-21T17:53:49+09:00</dc:date>
    <utime>1240304029</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/18.html">
    <title>開発部/技術/Visual Studio 2008/WPF/ガジェットっぽいコントロール/UserControl1.xaml</title>
    <link>https://w.atwiki.jp/axis-tec/pages/18.html</link>
    <description>
      #highlight(xml,linenumber){{
&lt;UserControl x:Class=&quot;UserControl1&quot;
    xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
    xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
    Height=&quot;321&quot; Width=&quot;336&quot; &gt;
    &lt;Grid&gt;
        &lt;DockPanel Margin=&quot;0&quot; Name=&quot;DockPanel1&quot;&gt;
            &lt;Thumb Height=&quot;23&quot; Name=&quot;Thumb1&quot; DockPanel.Dock=&quot;Top&quot; 
                   DragDelta=&quot;Thumb_DragDelta&quot; 
                   DragStarted=&quot;Thumb_DragStarted&quot; 
                   DragCompleted=&quot;Thumb_DragCompleted&quot; &gt;
                &lt;Thumb.Template&gt;
                    &lt;ControlTemplate&gt;
                        &lt;Border Height=&quot;23&quot;
                                CornerRadius=&quot;10,10,0,0&quot; Padding=&quot;0&quot;
                                Background=&quot;Turquoise&quot;
                                BorderBrush=&quot;AliceBlue&quot; BorderThickness=&quot;1&quot;&gt;
                        &lt;/Border&gt;
                    &lt;/ControlTemplate&gt;
                &lt;/Thumb.Template&gt;
            &lt;/Thumb&gt;
            &lt;Border Name=&quot;    </description>
    <dc:date>2009-04-21T16:40:11+09:00</dc:date>
    <utime>1240299611</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/17.html">
    <title>開発部/技術/Visual Studio 2008/WPF/ガジェットっぽいコントロール</title>
    <link>https://w.atwiki.jp/axis-tec/pages/17.html</link>
    <description>
      ガジェットっぽいコントロールを作ってみた。
サンプルなので、コントロール名、見た目はまったく考慮してません。。。（´д｀）ヾ
このコントロールは、Canvasに配置しドラッグによる表示位置の変更，およびサイズの変更ができる
ようにしています。（Canvasが置されているページで、このコントロールが通知するイベント
をハンドリングし配表示位置の変更を行います。）

まずは、画面部分。
----
&amp;u(){&amp;italic(){&amp;bold(){UserControl1.xaml}}}
#include(開発部/技術/Visual Studio 2008/WPF/ガジェットっぽいコントロール/UserControl1.xaml)
----    </description>
    <dc:date>2009-04-21T16:40:56+09:00</dc:date>
    <utime>1240299656</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/16.html">
    <title>昼飯情報</title>
    <link>https://w.atwiki.jp/axis-tec/pages/16.html</link>
    <description>
      食事処の情報を共有しましょう!





----    </description>
    <dc:date>2009-03-30T18:09:31+09:00</dc:date>
    <utime>1238404171</utime>
  </item>
    <item rdf:about="https://w.atwiki.jp/axis-tec/pages/15.html">
    <title>開発部/技術/Visual Studio 2008/WPF</title>
    <link>https://w.atwiki.jp/axis-tec/pages/15.html</link>
    <description>
      #ls3





----    </description>
    <dc:date>2009-04-21T13:15:38+09:00</dc:date>
    <utime>1240287338</utime>
  </item>
  </rdf:RDF>
