Exemple #1
0
        public LaunchpadWindow(Launchpad launchpad)
        {
            InitializeComponent();
            #if DEBUG
            this.AttachDevTools();
            #endif

            UpdateTopmost(Preferences.AlwaysOnTop);
            Preferences.AlwaysOnTopChanged += UpdateTopmost;

            _launchpad = launchpad;

            Title = TitleText.Text = TitleCenter.Text = _launchpad.Name;

            for (int i = 0; i < 100; i++)
            {
                Grid.SetColor(LaunchpadGrid.SignalToGrid(i), launchpad.GetColor(i).ToScreenBrush());
            }

            observables.Add(Grid.GetObservable(Visual.BoundsProperty).Subscribe(Grid_Updated));

            observables.Add(this.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(TitleText.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(TitleCenter.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(CenteringLeft.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
            observables.Add(CenteringRight.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated));
        }
Exemple #2
0
        public LaunchpadWindow(Launchpad launchpad)
        {
            InitializeComponent();
            #if DEBUG
            this.AttachDevTools();
            #endif

            UpdateTopmost(Preferences.AlwaysOnTop);
            Preferences.AlwaysOnTopChanged += UpdateTopmost;

            _launchpad = launchpad;

            Title = this.Get <TextBlock>("Title").Text = _launchpad.Name;

            for (int i = 0; i < 100; i++)
            {
                Grid.SetColor(LaunchpadGrid.SignalToGrid(i), launchpad.GetColor(i).ToScreenBrush());
            }

            Grid.GetObservable(Visual.BoundsProperty).Subscribe(Bounds_Updated);
        }