コード例 #1
0
        public DockWindow()
        {
            try
            {
                this.Closing += OnClosing;
                this.Loaded  += OnLoaded;

                _actionQueue  = new ActionQueue();
                IconRows      = Configuration.IconRows;
                ActiveScreen  = Configuration.ActiveScreen;
                DockPosition  = Configuration.DockPosition;
                AutoHide      = Configuration.AutoHide;
                PopupDelay    = Configuration.PopupDelay;
                AutoHideDelay = Configuration.AutoHideDelay;

                _appbar = new WpfAppBar(this)
                {
                    AutoHideDelay = AutoHideDelay,
                    PopupDelay    = PopupDelay,
                    ActiveScreen  = ActiveScreen,
                    ReserveScreen = Configuration.ReserveScreen
                };
                _appbar.AppBarEvent += OnAppBarEvent;

                Observable.FromEventPattern(this, "ContextMenuOpening").Subscribe(ep => _isContextMenuOpen = true);
                Observable.FromEventPattern(this, "ContextMenuClosing").Subscribe(ep => _isContextMenuOpen = false);
            }
            catch (Exception ex)
            {
                Log.Error(string.Format("Exception when creating the dock window, ErrorMessage: {0}, StackTrack: {1}",
                                        ex.Message, ex.StackTrace), ex);
                throw;
            }
        }
 public static bool TryGetAppBar(this PanaceaServices core, out IAppBar appbar)
 {
     appbar = core.PluginLoader.GetPlugins <IAppBarPlugin>().FirstOrDefault()?.GetAppBar();
     return(appbar != null);
 }
コード例 #3
0
        public DockWindow()
        {
            this.Closing += OnClosing;
            this.Loaded += OnLoaded;

            _actionQueue = new ActionQueue();
            IconRows = Configuration.IconRows;
            ActiveScreen = Configuration.ActiveScreen;
            DockPosition = Configuration.DockPosition;
            AutoHide = Configuration.AutoHide;
            PopupDelay = Configuration.PopupDelay;
            AutoHideDelay = Configuration.AutoHideDelay;

            _appbar = new WpfAppBar(this)
            {
                AutoHideDelay = AutoHideDelay,
                PopupDelay = PopupDelay,
                ActiveScreen = ActiveScreen,
                ReserveScreen = Configuration.ReserveScreen
            };
            _appbar.AppBarEvent += OnAppBarEvent;

            Observable.FromEventPattern(this, "ContextMenuOpening").Subscribe(ep => _isContextMenuOpen = true);
            Observable.FromEventPattern(this, "ContextMenuClosing").Subscribe(ep => _isContextMenuOpen = false);
        }