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;
        }
예제 #2
0
 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);
 }
예제 #3
0
 public static void OnDesignerLoaded()
 {
     foreach (IFlyout flyout in Game.Instance.Designer.DesignerUi.Flyouts.All)
     {
         flyout.Opened += OnOtherFlyoutOpened;
         flyout.Closed += OnOtherFlyoutClosed;
     }
     _openedFlyout = null;
 }
예제 #4
0
 public ShellViewModel(IWindowManager windowManager, IDialogCoordinator coordinator, ISettings settings)
 {
     _windowManager           = windowManager;
     Activated               += MainViewModel_Activated;
     _tabs.CollectionChanged += _tabs_CollectionChanged;
     _networksFlyout          = new NetworksFlyoutViewModel(coordinator, settings)
     {
         Parent = this
     };
 }
예제 #5
0
 public static void OnOtherFlyoutOpened(IFlyout flyout)
 {
     //Debug.Log ("Flyout Opened");
     _openedFlyout = flyout;
     if (designerToolsUI != null)
     {
         //Debug.Log ("Closing DT Flyout");
         designerToolsUI.Close();
         designerToolsUI = null;
     }
 }
예제 #6
0
        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);
        }
예제 #7
0
 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;
     }
 }
예제 #8
0
 public static void OnOtherFlyoutClosed(IFlyout flyout)
 {
     //Debug.Log ("Flyout Closed");
     _openedFlyout = null;
 }
예제 #9
0
 public SettingsModule([Import("Settings")] IFlyout settings)
 {
     this.settings = settings;
 }
예제 #10
0
        /// <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);
        }
예제 #11
0
        private void AddFlyoutToCollection(string flyoutKey, string flyoutRegion, IFlyout flyoutViewModel, FrameworkElement flyoutView)
        {
            RegisterFlyoutWithRegion(flyoutView, flyoutRegion);

            flyouts.Add(flyoutKey, flyoutViewModel);
        }
예제 #12
0
        /// <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));
        }