public 一个二级部件(bool tof) { //true for added items like 一个部件() //false for inserted items InitializeComponent(); 桥梁组成二级部件参数 = new 桥梁组成二级部件(); this.DataContext = 桥梁组成二级部件参数; 指标集合ListView.DataContext = this; if (!tof) { AddNewItem.MouseLeftButtonUp += DeleteItem; InsertNewItem.MouseLeftButtonUp += InsertNewItem_MouseLeftButtonUp; InsertNewItem.Visibility = Visibility.Visible; RotateTransform rotateTrans = new RotateTransform(); AddNewItem.RenderTransform = rotateTrans; DoubleAnimation rotateAnim = new DoubleAnimation(45, TimeSpan.FromMilliseconds(300)); rotateTrans.BeginAnimation(RotateTransform.AngleProperty, rotateAnim); } else { AddNewItem.MouseLeftButtonUp += AddNewItem_MouseLeftButtonUp; InsertNewItem.MouseLeftButtonUp += InsertNewItem_MouseLeftButtonUp; } }
public 一个二级部件() { InitializeComponent(); 桥梁组成二级部件参数 = new 桥梁组成二级部件(); this.DataContext = 桥梁组成二级部件参数; 指标集合ListView.DataContext = this; AddNewItem.MouseLeftButtonUp += AddNewItem_MouseLeftButtonUp; InsertNewItem.MouseLeftButtonUp += InsertNewItem_MouseLeftButtonUp; }