private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { //Correctly rotate the handle for vertical movement if (Orientation == Orientation.VerticalMovement) { gradientRotator.Angle = 0; } if (Orientation == Orientation.BiDimentionalMovement) { //No handle visible in BiDim case theBorder.Background = new SolidColorBrush(Colors.Blue); } //Don't attach events during design time if (DesignerProperties.GetIsInDesignMode(this)) { return; } var mainWindow = Application.Current.Windows.OfType <Window>().FirstOrDefault(); Mouse.AddPreviewMouseDownHandler(this, OnLocalMouseDown); Mouse.AddMouseLeaveHandler(this, OnLocalMouseLeave); Mouse.AddMouseEnterHandler(this, OnLocalMouseEnter); Mouse.AddPreviewMouseMoveHandler(mainWindow, OnGlobalMouseMove); Mouse.AddPreviewMouseUpHandler(mainWindow, OnGlobalMouseUp); }
private void onCanvasAttached() { Mouse.AddPreviewMouseDownHandler(canvas, OnMouseDown); Mouse.AddPreviewMouseMoveHandler(canvas, OnMouseMove); Mouse.AddPreviewMouseUpHandler(canvas, OnMouseUp); Mouse.AddPreviewMouseWheelHandler(canvas, OnMouseWheel); }
void IPlotterElement.OnPlotterAttached(Plotter plotter) { this.plotter = (Plotter2D)plotter; Mouse.AddPreviewMouseDownHandler(plotter.CentralGrid, OnMouseDown); Mouse.AddPreviewMouseUpHandler(plotter.CentralGrid, OnMouseUp); plotter.CentralGrid.MouseLeave += CentralGrid_MouseLeave; }
private void ColumnWidthPropertyChanged(object sender, EventArgs e) { // listen for when the mouse is released columnWidthChanging = sender as ColumnDefinition; if (sender != null) { Mouse.AddPreviewMouseUpHandler(this, ColumnResize_MouseLeftButtonUp); } }
private void ColumnWidthPropertyChanged(object sender, EventArgs e) { // listen for when the mouse is released this.columnWidthChanging = true; if (sender != null) { Mouse.AddPreviewMouseUpHandler(this, this.BaseDataGrid_MouseLeftButtonUp); } }
public override void OnPlotterAttached(Plotter plotter) { base.OnPlotterAttached(plotter); Mouse.AddPreviewMouseDownHandler(Parent, OnMouseDown); Mouse.AddPreviewMouseMoveHandler(Parent, OnMouseMove); Mouse.AddPreviewMouseUpHandler(Parent, OnMouseUp); Mouse.AddPreviewMouseWheelHandler(Parent, OnMouseWheel); }
private void RowWidthPropertyChanged(object sender, EventArgs e) { // listen for when the mouse is released rowHeightChanging = sender as RowDefinition; if (sender != null) { Mouse.AddPreviewMouseUpHandler(this, RowResize_MouseLeftButtonUp); } }
private void RowWidthPropertyChanged(object sender, EventArgs e) { if (SwimLaneView) { return; // Don't update Row.Size Values in SwimLaneView; } // listen for when the mouse is released rowHeightChanging = sender as RowDefinition; if (sender != null) { Mouse.AddPreviewMouseUpHandler(this, RowResize_MouseLeftButtonUp); } }
public MainContainerWindow() { InitializeComponent(); this.Top = 0; this.Left = 0; this.Width = SystemParameters.PrimaryScreenWidth; this.Height = SystemParameters.PrimaryScreenHeight; BezierDefineStartCoordinates(); //Releasing Mouse.Capture Mouse.AddPreviewMouseUpOutsideCapturedElementHandler(this, BezierReleaseMouseCapture); Mouse.AddPreviewMouseUpHandler(this, BezierReleaseMouseCapture); MainContainerWindow.MainContainer = this; }
//public TopPanelItem() //{ // InitializeComponent(); //} public TopPanelItem(TopPanelItemConfiguration config, TopPanel parent) { InitializeComponent(); Configuration = config; C_Name.Text = System.IO.Path.GetFileNameWithoutExtension(config.Path); SetIcon(); Canvas.SetLeft(this, config.X); Canvas.SetTop(this, config.Y); _parentPanel = parent; Mouse.AddPreviewMouseUpOutsideCapturedElementHandler(this, ReleaseMouseCapture); Mouse.AddPreviewMouseUpHandler(this, ReleaseMouseCapture); InitializeAnimations(); }
/// <summary> /// Initializes a new instance of the <see cref="Track"/> class. /// </summary> /// <param name="uv">The Ultraviolet context.</param> /// <param name="name">The element's identifying name within its namescope.</param> public Track(UltravioletContext uv, String name) : base(uv, name) { this.Thumb = new Button(uv, null) { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, Focusable = false, }; this.Thumb.Classes.Add("track-thumb"); this.Thumb.ChangeLogicalAndVisualParents(this, this); KeyboardNavigation.SetIsTabStop(this.Thumb, false); this.IncreaseButton = new RepeatButton(uv, null) { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, Opacity = 0, Focusable = false, }; this.IncreaseButton.Classes.Add("track-increase"); this.IncreaseButton.Click += HandleIncreaseButtonClick; this.IncreaseButton.ChangeLogicalAndVisualParents(this, this); KeyboardNavigation.SetIsTabStop(this.IncreaseButton, false); this.DecreaseButton = new RepeatButton(uv, null) { HorizontalAlignment = HorizontalAlignment.Stretch, VerticalAlignment = VerticalAlignment.Stretch, Opacity = 0, Focusable = false, }; this.DecreaseButton.Classes.Add("track-decrease"); this.DecreaseButton.Click += HandleDecreaseButtonClick; this.DecreaseButton.ChangeLogicalAndVisualParents(this, this); KeyboardNavigation.SetIsTabStop(this.DecreaseButton, false); Mouse.AddPreviewMouseMoveHandler(this.Thumb, HandleThumbPreviewMouseMove); Mouse.AddPreviewMouseDownHandler(this.Thumb, HandleThumbPreviewMouseDown); Mouse.AddPreviewMouseUpHandler(this.Thumb, HandleThumbPreviewMouseUp); }