for WPF developers
Home Profile Tips 全記事一覧

App.xaml に記述されている StartupUri プロパティを削除する

(2017/03/07 15:18:27 created.)

(2017/03/07 15:28:10 modified.)

デフォルトでは MainWindow.xaml で定義されていたウィンドウがアプリケーション起動時に表示されるように、App.xaml に StartupUri プロパティとして "MainWindow.xaml" が指定されていました。ここでは MainWindow は存在しないため、この記述を削除します。

また、起動時にウィンドウを表示するコードはコードビハインドである App.xaml.csに記述するため、ここでは特に追加しません。

App.xaml
  1. <Application x:Class="Tips_MarkupExtension.App"
  2.              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3.              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  4.     <Application.Resources>
  5.          
  6.     </Application.Resources>
  7. </Application>