/// <summary> /// Called after the behavior is attached to an AssociatedObject. /// </summary> /// <remarks> /// Override this to hook up functionality to the AssociatedObject. /// </remarks> protected override void OnAttached() { base.OnAttached(); this.currentWindow = AssociatedObject as EtchedWindow; this.currentWindow.Loaded += CurrentWindow_Loaded; //base.OnAttached(); }
/// <summary> /// Called after the behavior is attached to an AssociatedObject. /// </summary> /// <remarks> /// Override this to hook up functionality to the AssociatedObject. /// </remarks> protected override void OnAttached() { base.OnAttached(); this.currentWindow = AssociatedObject as EtchedWindow; this.currentWindow.MouseLeftButtonDown += (o, e) => { if (e.ChangedButton == MouseButton.Left) { // Drag started this.currentWindow.RaiseStartWindowDragEvent(); currentWindow.DragMove(); // Drag ended this.currentWindow.RaiseFinishWindowDragEvent(); } }; }