private void arrowsPanel_Resize(object sender, EventArgs e) { arrowsAreaSize = new ReadonlyRef <Size>(arrowsPanel.ClientSize.ToSize()); if (viewModel != null) { viewModel.ChangeNotification.Post(); } }
public override void AwakeFromNib() { base.AwakeFromNib(); tagsListController.View.MoveToPlaceholder(tagsViewPlaceholder); quickSearchTextBox.View.MoveToPlaceholder(quickSearchPlaceholder); PlaceToastNotificationsView(toastNotifications.View, arrowsView); rolesCaptionsView.BackgroundColor = NSColor.TextBackground; rolesCaptionsView.OnPaint = PaintRolesCaptionsView; arrowsView.BackgroundColor = NSColor.TextBackground; arrowsView.OnPaint = PaintArrowsView; arrowsView.OnMagnify = ArrowsViewMagnify; arrowsView.OnMouseDown = ArrowsViewMouseDown; arrowsView.OnMouseUp = ArrowsViewMouseUp; arrowsView.OnMouseDragged = ArrowsViewMouseDrag; arrowsView.OnScrollWheel = ArrowsViewScrollWheel; NSNotificationCenter.DefaultCenter.AddObserver(NSView.FrameChangedNotification, ns => { arrowsAreaSize = new ReadonlyRef <Size>( arrowsView.Frame.Size.ToSizeF().ToSize()); viewModel?.ChangeNotification?.Post(); }, arrowsView); leftPanelView.BackgroundColor = NSColor.TextBackground; leftPanelView.OnPaint = PaintLeftPanel; leftPanelView.OnMouseDown = LeftPanelMouseDown; vertScroller.Action = new Selector("OnVertScrollChanged"); vertScroller.Target = this; horzScroller.Action = new Selector("OnHorzScrollChanged"); horzScroller.Target = this; arrowDetailsLink.LinkClicked = (s, e) => viewModel.OnTriggerClicked(e.Link.Tag); arrowDetailsLink.BackgroundColor = NSColor.TextBackground; Window.InitialFirstResponder = arrowsView; Window.WillClose += (s, e) => viewModel.OnWindowHidden(); }