注:ASP.NETというMicrosoftのウェブプログラム開発フレームワークで使われる概念です。("Code-behind is a concept commonly used in ASP.NET web development.")webデザインのHTMLとは別の言語による処理コードを意味します。("Code-behind refers to code for your ASP.NET page and allows a clean separation of your HTML from your presentation logic.")
BCCForm and BCCSkeltonの話でいえば、bcc32c.exeというコンパイラーでコンパイルする為に、"*.mak"というビルドファイルを使って"make.exe"がビルドし、Microsoft .NET FrameworkのC#であれば、csc.exeというコンパイラーでコンパイルする為に"*.csproj"という、(またしても!)Xamlで記述されたビルドファイルを使って”MSBuild.exe”がビルドします。(注)
MainWindow mwnd = new MainWindow();
Application ap = new Application(); //明示的にインスタンスを作らなければならない
ap.Run(mwnd);
}
}
public partial class MainWindow : Window //派生元が"Form"から"Window"となる
{
public MainWindow()
{ //this.Loaded += new RoutedEventHandler(Window_Loaded);
//this.ContentRendered += new EventHandler(Window_ContentRendered);
///////////////
// Window03.cs
///////////////
using System;
using System.Windows;
using System.Windows.Controls; //コントロールを利用する為
using System.Windows.Media.Imaging; //BitmapFrameを使用する為
namespace Window03
{ ///////////////////////////
//エントリーポイントクラス
///////////////////////////
class MainApp
{
[STAThread]
public static void Main()
{
MainWindow mwnd = new MainWindow();
Application ap = new Application();
ap.Run(mwnd);
}
}
///////////////
// Window02.cs
///////////////
using System;
using System.Windows;
using System.Windows.Controls; //コントロールを利用する為
using System.Windows.Media.Imaging; //BitmapFrameを使用する為
namespace Window02
{ ///////////////////////////
//エントリーポイントクラス
///////////////////////////
class MainApp
{
[STAThread]
public static void Main()
{
MainWindow mwnd = new MainWindow();
Application ap = new Application(); //解説:インスタンスを作らないとエラーになりました。
ap.Run(mwnd);
}
}
public partial class MainWindow : Window
{
public MainWindow()
{
DefWindow(); //ウィンドウのプロパティを設定する
}
"A Content control is a container for the content and controls of a content page. A Content control is used only with a master page that defines a corresponding ContentPlaceHolder control. A Content control is not added to the control hierarchy at runtime. Instead, the contents within the Content control are directly merged into the corresponding ContentPlaceHolder control."