WPF(2)-分離程式邏輯與外觀

WPF(2)-分離程式邏輯與外觀

.xaml

.xaml.cs

namespace WindowsApplication1
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>

public partial class Window1 : System.Windows.Window
{

public Window1()
{
InitializeComponent();
}

public void click(object sender,RoutedEventArgs e)
{
Button x = (Button)sender;
if(x.Width==900)
{
x.Width = 600;
x.Height = 200;
}
else
{
x.Width = 900;
x.Height = 300;
}

}

public void click1(object sender, RoutedEventArgs e)
{
Button y = (Button)sender;
if (y.Width ==900)
{
y.Width = 120;
y.Height = 40;
}
else
{
y.Width = 900;
y.Height = 300;
}

}
}
}
以上是一個簡單的範例,由美工人員設計XAML,程式開發人員來負責.CS的部份,之後會開始先po一些xaml的基礎,asp.net ajax也是會持續的喔^^。