Пример #1
0
        public TrackWindow(Track track)
        {
            InitializeComponent();
            #if DEBUG
            this.AttachDevTools();
            #endif

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

            _track = track;

            ChainViewer chainViewer = new ChainViewer(_track.Chain);
            chainViewer.PointerWheelChanged += Track_Scroll;

            Selection = new SelectionManager(() => _track.Chain.Devices.FirstOrDefault());

            Root = chainViewer.Get <Grid>("Layout");
            UpdateContentAlignment(Preferences.CenterTrackContents);
            Preferences.CenterTrackContentsChanged += UpdateContentAlignment;

            Contents.Content = chainViewer;

            SetEnabled();

            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));
        }
Пример #2
0
        public TrackWindow(Track track)
        {
            InitializeComponent();
            #if DEBUG
            this.AttachDevTools();
            #endif

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

            _track = track;

            ChainViewer chainViewer = new ChainViewer(_track.Chain);
            chainViewer.PointerWheelChanged += Track_Scroll;

            Root = chainViewer.Get <Grid>("Layout");
            UpdateContentAlignment(Preferences.CenterTrackContents);
            Preferences.CenterTrackContentsChanged += UpdateContentAlignment;

            Contents.Content = chainViewer;

            SetEnabled();
        }