public MenuButton(UserButton userButton, Home_ChangeCC_Function callback1, Home_PopUpButtons_Function callback2, Home_ChangeBtnSP_Function callback3 = null) { InitializeComponent(); Home_ChangeCC_Event += callback1; Home_PopUpButtons_Event += callback2; Home_ChangeBtnSP_Event += callback3; this.userButton = userButton; base.Loaded += new RoutedEventHandler(MenuButton_Loaded); base.Unloaded += new RoutedEventHandler(MenuButton_Unloaded); InitSelectDB(); InitUI(); InitEvent(); }
// 按鈕不要非同步載入,不然會被延後載入的按鈕 // 把按鈕變成彈起的狀態。 public MenuButton(UserButton userButton, Home_ChangeCC_Function callback1, Home_PopUpButtons_Function callback2, Home_ChangeBtnSP_Function callback3 = null) { //MouseTool.ShowLoading(); InitializeComponent(); this.Home_ChangeCC_Event += callback1; this.Home_PopUpButtons_Event += callback2; this.Home_ChangeBtnSP_Event += callback3; this.userButton = userButton; this.Loaded += MenuButton_Loaded; this.Unloaded += MenuButton_Unloaded; InitSelectDB(); InitUI(); InitEvent(); //MouseTool.ShowArrow(); }