?? bmbutton.cs
字號:
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
namespace DTSample
{
class BindingClass// : INotifyPropertyChanged
{
public BindingClass(string c, double h)
{
content = c;
height = h;
}
public BindingClass()
{
content = "default binding";
height = 0;
}
private string content;
public string Content
{
get { return content; }
set
{
content = value;
// OnPropertyChanged("content");
}
}
private double height;
public double Height
{
get { return height; }
set
{
height = value;
//OnPropertyChanged("Height");
}
}
//public event PropertyChangedEventHandler PropertyChanged;
//private void OnPropertyChanged(String info)
//{
// if (PropertyChanged != null)
// PropertyChanged(this, new PropertyChangedEventArgs(info));
//}
//public override string ToString()
//{
// return Content;
//}
}
class BindingList : ObservableCollection<BindingClass>
{
public BindingList()
{
base.Add(new BindingClass("hello",1));
base.Add(new BindingClass("happy",2));
base.Add(new BindingClass("happy", 3));
base.Add(new BindingClass("happy", 4));
}
}
//class BindingList : List<BindingClass>
//{
//}
//public class ItemTemplateSelector : DataTemplateSelector
//{
// public override DataTemplate SelectTemplate(object item, DependencyObject container)
// {
// if (item != null && item is BindingClass)
// {
// BindingClass taskitem = item as BindingClass;
// Window window = Application.Current.MainWindow;
// if (taskitem.Content == "hello")
// return
// window.FindResource("Template1") as DataTemplate;
// else
// return
// window.FindResource("Template2") as DataTemplate;
// }
// return null;
// }
//}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -