using System; using System.Windows; using System.Windows.Controls; using System.Windows.Input; using static QuikDawEditor.EDITING.StaticProperties; namespace QuikDawEditor { public partial class MixerControl : UserControl { public MixerControl() { InitializeComponent(); } bool MouseOverBorderTop = false; bool MouseDownOnBorderTop = false; double MouseDownOnBorderY = 0; double MouseDownStartHeight; private void MixerPanel_PreviewMouseUp(object sender, MouseButtonEventArgs e) { MouseDownOnBorderTop = false; this.ReleaseMouseCapture(); } private void MixerPanel_PreviewMouseDown(object sender, MouseButtonEventArgs e) { if (MouseOverBorderTop) { MouseDownOnBorderTop = true; MouseDownOnBorderY = e.GetPosition(this).Y; MouseDownStartHeight = this.ActualHeight; this.CaptureMouse(); return; } } private void MixerPanel_PreviewMouseMove(object sender, MouseEventArgs e) { if (MouseDownOnBorderTop) { this.Height = MouseDownStartHeight + (MouseDownOnBorderY - e.GetPosition(this).Y); return; } if (e.GetPosition(this).Y < 10) { MouseOverBorderTop = true; Cursor = Cursors.SizeNS; return; } else { MouseOverBorderTop = false; Cursor = Cursors.Arrow; } } private void MixerTracksIC_PreviewMouseWheel(object sender, MouseWheelEventArgs e) { MixerSV.ScrollToHorizontalOffset(MixerSV.HorizontalOffset + Math.Sign(e.Delta) * 10); } private void HideBut_Click(object sender, RoutedEventArgs e) { editingProject.IsMixerVisible = false; editingProject.NeedsSaving = true; } } }