LoginSignup
11
11

More than 5 years have passed since last update.

UWP開発のメモ

Posted at

検索の仕方

UWPの情報が少ない上に、似た異様なコードが大量に引っかかるのが厄介
WinRTをキーワードに追加するとチョット良い。


//デザインモード判定
var isDesignMode = windows.ApplicationModel.DesignMode.DesignModeEnabled;

if(!isDesignMode){
    //デザインモードじゃないときの処理
}                        

//コンソール出力
Debug.WriteLine("hoge");

System.ApplicationException が見つかりません。

抑制状態 エラー
モジュール CommonLanguageRuntimeLibrary で型System.ApplicationException が見つかりません。

UWPにはSystem.ApplicationExceptionが存在しないので、それを使ってるクラスは全滅っぽいーぽいー。
てゆか基本的に旧DLLはダメ?

Log4netが使えない?

だめっぽい。
MetroLogを使いましょう。

shift_jisが使えない?

System.Text.Encoding enc = System.Text.Encoding.GetEncoding("shift_jis");
System.ArgumentException: 'shift_jis' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.

ドロップシャドウは?

<StackPanel.BitmapEffect>
  <DropShadowBitmapEffect Color="Black" Direction="270" ShadowDepth="5" Softness="1" Opacity="0.5"/>
</StackPanel.BitmapEffect>

だめっぽい、UWPはエフェクトサポートしてないらしい。
まじか、耳を疑いましたわ。
どうしよう。

埋め込みリソースをImageタグで表示する

<Image Source="ms-appx:///Resources/hoge.png"/>

Drag and Dropで移動可能なオブジェクト

WPFではThumbを継承して使うのが簡単で良かったのですが

シール型'Thumb'から派生することはできません。

なんでシール型にするかね。。

InkCanvasのEditableMode

inkCanvas.InkPresenter.InputProcessingConfiguration.Mode

ペン >> InkInputProcessingMode.Inking
消しゴム(Stroke) >> InkInputProcessingMode.Erasing
消しゴム(Point) >> 無し

EraseByPoint無しですよ、無し。
普通の消しゴムは実装されていません、使えねぇ。。

11
11
3

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
11
11