void OrderingItemsButtons_Loaded(object sender, RoutedEventArgs e) { if (!System.ComponentModel.DesignerProperties.GetIsInDesignMode(this)) { if (!isReady) { MoveTopButton.SetBinding(Button.CommandProperty, new Binding("TopCommand") { Source = this }); MoveUpButton.SetBinding(Button.CommandProperty, new Binding("UpCommand") { Source = this }); MoveDownButton.SetBinding(Button.CommandProperty, new Binding("DownCommand") { Source = this }); MoveToLastButton.SetBinding(Button.CommandProperty, new Binding("BottomCommand") { Source = this }); RegisterCommand(); this.Unloaded += new RoutedEventHandler(OrderingItemsButtons_Unloaded); isReady = true; } } }
void ReleaseDesignerOutlets() { if (ConnectBluetoothButton != null) { ConnectBluetoothButton.Dispose(); ConnectBluetoothButton = null; } if (DisconnectButton != null) { DisconnectButton.Dispose(); DisconnectButton = null; } if (MoveDownButton != null) { MoveDownButton.Dispose(); MoveDownButton = null; } if (MoveLeftButton != null) { MoveLeftButton.Dispose(); MoveLeftButton = null; } if (MovementView != null) { MovementView.Dispose(); MovementView = null; } if (MoveRightButton != null) { MoveRightButton.Dispose(); MoveRightButton = null; } if (MoveUpButton != null) { MoveUpButton.Dispose(); MoveUpButton = null; } if (OptionsView != null) { OptionsView.Dispose(); OptionsView = null; } }