public static void OnDesignerLoaded() { IFlyouts _Flyouts = Game.Instance.Designer.DesignerUi.Flyouts; _Flyouts.ActivationGroups.Opened += OnOtherFlyoutOpened; _Flyouts.ActivationGroups.Closed += OnOtherFlyoutClosed; _Flyouts.CraftParts.Opened += OnOtherFlyoutOpened; _Flyouts.CraftParts.Closed += OnOtherFlyoutClosed; _Flyouts.LoadCraft.Opened += OnOtherFlyoutOpened; _Flyouts.LoadCraft.Closed += OnOtherFlyoutClosed; _Flyouts.Menu.Opened += OnOtherFlyoutOpened; _Flyouts.Menu.Closed += OnOtherFlyoutClosed; _Flyouts.PartConnections.Opened += OnOtherFlyoutOpened; _Flyouts.PartConnections.Opened += OnOtherFlyoutClosed; _Flyouts.PartList.Opened += OnOtherFlyoutOpened; _Flyouts.PartList.Closed += OnOtherFlyoutClosed; _Flyouts.PartProperties.Opened += OnOtherFlyoutOpened; _Flyouts.PartProperties.Closed += OnOtherFlyoutClosed; _Flyouts.StagingEditor.Opened += OnOtherFlyoutOpened; _Flyouts.StagingEditor.Closed += OnOtherFlyoutClosed; _Flyouts.Symmetry.Opened += OnOtherFlyoutOpened; _Flyouts.Symmetry.Closed += OnOtherFlyoutClosed; _Flyouts.Tools.Opened += OnOtherFlyoutOpened; _Flyouts.Tools.Closed += OnOtherFlyoutClosed; _OpenedFlyout = null; }
public void RegisterFlyoutWithDefaultRegion <TView>(string flyoutKey, IFlyout viewModel) where TView : FrameworkElement { if (String.IsNullOrEmpty(defaultFlyoutRegion)) { throw new NullReferenceException("Default region not set."); } RegisterFlyout <TView>(flyoutKey, defaultFlyoutRegion, viewModel); }
public static void OnDesignerLoaded() { foreach (IFlyout flyout in Game.Instance.Designer.DesignerUi.Flyouts.All) { flyout.Opened += OnOtherFlyoutOpened; flyout.Closed += OnOtherFlyoutClosed; } _openedFlyout = null; }
public ShellViewModel(IWindowManager windowManager, IDialogCoordinator coordinator, ISettings settings) { _windowManager = windowManager; Activated += MainViewModel_Activated; _tabs.CollectionChanged += _tabs_CollectionChanged; _networksFlyout = new NetworksFlyoutViewModel(coordinator, settings) { Parent = this }; }
public static void OnOtherFlyoutOpened(IFlyout flyout) { //Debug.Log ("Flyout Opened"); _openedFlyout = flyout; if (designerToolsUI != null) { //Debug.Log ("Closing DT Flyout"); designerToolsUI.Close(); designerToolsUI = null; } }
private IFlyout GetFlyoutViewModelFromView(FrameworkElement flyoutView) { IFlyout flyoutViewModel = flyoutView.DataContext as IFlyout; if (flyoutViewModel == null) { throw new ArgumentException(@"Type passed must have an auto-wired view model that implements IFlyout. If auto-wiring is not used then pass the viewmodel instance to the overloaded RegisterFlyout method."); } return(flyoutViewModel); }
private static void OnButtonClicked() { if (designerToolsUI != null) { designerToolsUI.Close(); designerToolsUI = null; _flyoutButton.SetAndApplyAttribute("colors", "Button|ButtonHover|ButtonPressed|ButtonDisabled"); _openedFlyout = null; } else { var ui = Game.Instance.UserInterface; designerToolsUI = ui.BuildUserInterfaceFromResource <DesignerToolsUI> ("DesignerTools/Designer/DesignerTools", (script, controller) => script.OnLayoutRebuilt(controller)); _designer.DesignerUi.CloseFlyout(_designer.DesignerUi.SelectedFlyout); _flyoutButton.SetAndApplyAttribute("colors", "ButtonPressed|ButtonHover|ButtonPressed|ButtonDisabled"); _openedFlyout = designerToolsUI.flyout; } }
public static void OnOtherFlyoutClosed(IFlyout flyout) { //Debug.Log ("Flyout Closed"); _openedFlyout = null; }
public SettingsModule([Import("Settings")] IFlyout settings) { this.settings = settings; }
/// <summary> /// Register Flyout with FlyoutManager, a viewmodel must be supplied that derives from IFlyout. /// </summary> /// <typeparam name="TView">Type of the view used for the flyout.</typeparam> /// /// <param name="flyoutKey">A key to identify the flyout.</param> /// <param name="flyoutRegion">The region name in which to display the flyout.</param> /// <param name="flyoutViewModel"></param> public void RegisterFlyout <TView>(string flyoutKey, string flyoutRegion, IFlyout flyoutViewModel) where TView : FrameworkElement { var flyoutView = ResolveFlyoutView <TView>(); AddFlyoutToCollection(flyoutKey, flyoutRegion, flyoutViewModel, flyoutView); }
private void AddFlyoutToCollection(string flyoutKey, string flyoutRegion, IFlyout flyoutViewModel, FrameworkElement flyoutView) { RegisterFlyoutWithRegion(flyoutView, flyoutRegion); flyouts.Add(flyoutKey, flyoutViewModel); }
/// <summary> /// Remove the specified Flyout from this FlyoutManager /// </summary> /// <param name="flyout">The flyout to remove.</param> public void UnRegisterFlyout(IFlyout flyout) { var items = flyouts.Where(kvp => kvp.Value == flyout).ToList(); items.ForEach(item => UnRegisterFlyout(item.Key)); }