private void HandleInteractiveItemHit(InteractableItemViewModel vm) { var callback = _hostedLayoutActions[vm.Action]; callback(vm); HandleToggleItemGroups(vm); }
private void OnNavigateToPage(InteractableItemViewModel obj) { if (!ViewModel.Pages.Contains(obj.PageTarget)) { Debug.Log("WARNING: page target not found in view model pages collection"); } SelectedPage = obj.PageTarget; }
private void OnCloseContent(InteractableItemViewModel obj) { obj.ContentAreaTarget.Content = null; if (obj is ToggleItemViewModel t) { if (t.DefaultState == ToggleItemState.Normal) { t.Action = HostedLayoutAction.OpenContentToArea; } } }
private void OnOpenContentToArea(InteractableItemViewModel obj) { obj.ItemTarget.Parent = obj.ContentAreaTarget; obj.ContentAreaTarget.Content = obj.ItemTarget; if (obj is ToggleItemViewModel t) { if (t.DefaultState == ToggleItemState.Selected) { t.Action = HostedLayoutAction.CloseContent; } } }
private void HandleToggleItemGroups(InteractableItemViewModel item) { if (item is ToggleItemViewModel ivm) { if (ivm.ToggleGroup != null) { var group = _toggleItemGroups[ivm.ToggleGroup]; foreach (var x in group) { if (x == ivm) { continue; } x.DefaultState = ToggleItemState.Normal; } } } }
private void BeginHighlightItem(InteractableItemViewModel obj) { if (obj.Shape == null) { return; } var points = new PointCollection(); foreach (var point in obj.Shape) { points.Add(new Point(point.X, point.Y)); } var poly = new Polygon { Fill = (Brush)IntToSolidColorBrushConverter.Instance.Convert(obj.HighlightColor, typeof(SolidColorBrush), null, "en"), Points = points, }; pnlHighlightCanvas.Children.Add(poly); }
private void OnOpenPopup(InteractableItemViewModel obj) { obj.ItemTarget.Parent = obj.ContentAreaTarget; obj.ContentAreaTarget.Content = null; obj.ContentAreaTarget.Content = obj.ItemTarget; }
private void OnOpenContentToWindow(InteractableItemViewModel obj) { _menuSelectedItemBus.Publish(obj.ItemTarget, this); }
private void EndHighlightItem(InteractableItemViewModel obj) { pnlHighlightCanvas.Children.Clear(); }