Window.AllowsTransparency, XamlDebuggingInformation, WPF

Published 25 August 06 04:09 PM | hiroyuk 

AllowsTransparency

laurenlavoieのブログで参照されているように、Windows Presentation Foundation (WPF) では、Windows.AllowsTransparencyプロパティを使って、ウィンドウの背景を透明にすることができます。実はJune CTPでやっと動作するようになりました。次のように記述します。

<Window x:Class="WindowTransparency.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="WindowTransparency" Height="300" Width="300"
    AllowsTransparency="True" WindowStyle="None"
    Background="Transparent"
    >
  <Border CornerRadius="50" Background="Blue" Opacity=".7">
    <Button Click="CloseWindow" Height="30" Width="100">Close Me
    </Button>
  </Border>
</Window>
以前紹介したDesktop Window Managerによるぼかしつきの半透明とは違うことに注意してください。したがってXPでも動作しますが、ピクセル単位のぼかしのような効果はありません。Windows Media Playerのようにスキンを使いたいときや、非矩形のウィンドウを作成したいときに使うものです。
 

XamlDebuggingInformation

これもNick Kramerのブログで紹介されていますが、実行時エラーのXAMLの行数をメッセージに表示させることができるようになりました。.csproj や.vsproj内のプロジェクトファイルのPropertyGroupタグの下に以下の行を追加するだけです。

<XamlDebuggingInformation>true</XamlDebuggingInformation>

Comments

No Comments
Anonymous comments are disabled

About hiroyuk

マイクロソフト㈱エバンジェリスト。北海道大学理学部物理学科卒。リアルタイム3Dグラフィックスを専門とし、グラフィックスやシェーダに関する技術文章を執筆・講演。 DirectX SDK日本語ドキュメントの開発に携わるとともに、Windows Presentation Foundation プログラミング(オーム社)、Game Programming Gemsシリーズ、リアルタイム レンダリング第2版(ボーンデジタル)、Texturing & Modeling, A Procedural Approach などを翻訳・監修、XAMLプログラミング(ソフトバンク クリエイティブ)を執筆。趣味は薪割り。

Search

This Blog

DirectX 情報

Silverlight 情報

Windows 情報

WPF 情報

並列コンピューティング情報

著書

Syndication

Page view tracker