Exemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Deskband"/> class.
        /// </summary>
        public Deskband()
        {
            // Fluentwpf requires an application window
            if (System.Windows.Application.Current == null)
            {
                new System.Windows.Application().MainWindow = new Window();
            }

            var initialSize = new DeskBandSize(50, 30);

            Options.HorizontalSize    = initialSize;
            Options.MinHorizontalSize = initialSize;
            AudioBandLogManager.Initialize();
            _logger = AudioBandLogManager.GetLogger("AudioBand");
            _logger.Info("Starting AudioBand. Version: {version}, OS: {os}", GetType().Assembly.GetCustomAttribute <AssemblyInformationalVersionAttribute>().InformationalVersion, Environment.OSVersion);

            StartupCheck();

            AppDomain.CurrentDomain.UnhandledException += CurrentDomainOnUnhandledException;
            AppDomain.CurrentDomain.AssemblyResolve    += CurrentDomainOnAssemblyResolve;

            ConfigureDependencies();

            _settingsWindow   = _container.GetInstance <SettingsWindow>();
            _audioBandToolbar = _container.GetInstance <AudioBandToolbar>();

            _container.GetInstance <IMessageBus>().Subscribe <FocusChangedMessage>(FocusCaptured);
        }
Exemplo n.º 2
0
        public Deskband()
        {
            var          toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight - SystemParameters.WindowCaptionHeight;
            DeskBandSize size          = new DeskBandSize(100, -1);

            Options.MinHorizontalSize = size;
        }
Exemplo n.º 3
0
        private void OnSizeChanged(object sender, SizeChangedEventArgs e)
        {
            var scale        = VisualTreeHelper.GetDpi(this).PixelsPerInchY / 96.0;
            var deskbandSize = new DeskBandSize((int)Math.Round(ActualWidth * scale), (int)Math.Round(ActualHeight * scale));

            _options.MinHorizontalSize   = deskbandSize;
            _options.HorizontalSize      = deskbandSize;
            _options.MaxHorizontalHeight = deskbandSize.Height;
        }