/// <summary>
        /// Display the data entry box over an object and display infomation about that object.
        /// </summary>
        /// <param name="dataObjectVM">Object to display infomation about</param>
        public void DisplayEntryBox(InterstellaObjectViewModel dataObjectVM)
        {
            // Set the data Object VM and notify of changed properties
            DataObjectVM = dataObjectVM;
            notifyOnDataObjectChanged();

            // Make the control visible
            Visibility = true;
            NotifyPropertyChanged(this, nameof(Visibility));

            // Set the screen position of the control.
            ScreenXY = new Vector(
                dataObjectVM.ScreenPosition.X + CanvasPageViewModel.Instance.SideBarWidth + DataObjectVM.Width / 2,
                dataObjectVM.ScreenPosition.Y + DataObjectVM.Height / 2
                );

            NotifyPropertyChanged(this, nameof(ScreenXY));
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Sets the virtual origin to always reflect position of an object.
 /// This Object will always be at the centre of the canvas.
 /// </summary>
 /// <param name="FocusableObject"></param>
 static public void FocusOnObject(InterstellaObjectViewModel focusableObject)
 {
     FocusedOnObject = true;
     PanFocusObject  = focusableObject;
 }