public async void Drag(object sender, PointerPressedEventArgs e) { if (!selected) { Select(e); } DataObject dragData = new DataObject(); dragData.Set("track", Program.Project.Window?.Selection.Selection); DragDropEffects result = await DragDrop.DoDragDrop(dragData, DragDropEffects.Move); if (result == DragDropEffects.None) { if (selected) { Select(e); } if (e.MouseButton == MouseButton.Left && e.ClickCount == 2) { TrackWindow.Create(_track, (Window)this.GetVisualRoot()); } if (e.MouseButton == MouseButton.Right) { MuteItem.Header = ((Track)Program.Project.Window?.Selection.Selection.First()).Enabled? "Mute" : "Unmute"; TrackContextMenu.Open(Draggable); } } }
private void DeveloperButton_OnClick(object sender, RoutedEventArgs e) { StaticValues.developerMode = true; _trackWindow = new TrackWindow(); this.Close(); _trackWindow.Show(); }
private void NewUserTestButton_OnClick(object sender, RoutedEventArgs e) { StaticValues.developerMode = false; StaticValues.User = new User(TesterName.Text); _trackWindow = new TrackWindow(); this.Close(); _trackWindow.Show(); }
public void DragFailed(PointerPressedEventArgs e) { PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind; if (MouseButton == PointerUpdateKind.LeftButtonPressed && e.ClickCount == 2) { TrackWindow.Create(_track, (Window)this.GetVisualRoot()); } if (MouseButton == PointerUpdateKind.RightButtonPressed) { MuteItem.Header = ((Track)Program.Project.Window?.Selection.Selection.First()).Enabled? "Mute" : "Unmute"; ((ApolloContextMenu)this.Resources["TrackContextMenu"]).Open(Draggable); } }
private void Input_LostFocus(object sender, RoutedEventArgs e) { Input.Text = _chain.Name; Input.Opacity = 0; Input.IsHitTestVisible = false; List <string> r = (from i in Enumerable.Range(0, Input_Clean.Count) select Input.Text).ToList(); if (!r.SequenceEqual(Input_Clean)) { int left = Input_Left; int right = Input_Right; List <string> u = (from i in Input_Clean select i).ToList(); List <int> path = Track.GetPath(_chain); Program.Project.Undo.Add($"Chain Renamed to {Input.Text}", () => { Chain chain = ((Chain)Track.TraversePath(path)); IMultipleChainParent parent = (IMultipleChainParent)chain.Parent; for (int i = left; i <= right; i++) { parent[i].Name = u[i - left]; } TrackWindow window = Track.Get(chain)?.Window; window?.Selection.Select(parent[left]); window?.Selection.Select(parent[right], true); }, () => { Chain chain = ((Chain)Track.TraversePath(path)); IMultipleChainParent parent = (IMultipleChainParent)chain.Parent; for (int i = left; i <= right; i++) { parent[i].Name = r[i - left]; } TrackWindow window = Track.Get(chain)?.Window; window?.Selection.Select(parent[left]); window?.Selection.Select(parent[right], true); }); } }
public async void Drag(object sender, PointerPressedEventArgs e) { PointerUpdateKind MouseButton = e.GetCurrentPoint(this).Properties.PointerUpdateKind; if (!selected) { Select(e); } DataObject dragData = new DataObject(); dragData.Set("track", Program.Project.Window?.Selection.Selection); App.Dragging = true; DragDropEffects result = await DragDrop.DoDragDrop(e, dragData, DragDropEffects.Move); App.Dragging = false; if (result == DragDropEffects.None) { if (selected) { Select(e); } if (MouseButton == PointerUpdateKind.LeftButtonPressed && e.ClickCount == 2) { TrackWindow.Create(_track, (Window)this.GetVisualRoot()); } if (MouseButton == PointerUpdateKind.RightButtonPressed) { MuteItem.Header = ((Track)Program.Project.Window?.Selection.Selection.First()).Enabled? "Mute" : "Unmute"; ((ApolloContextMenu)this.Resources["TrackContextMenu"]).Open(Draggable); } } }