internal void SplitViewDimensionsChanged(SplitPaneViewModel splitPaneViewModel)
 {
     if (splitPaneViewModel == ActiveView && _beView != null)
     {
         _beView.FirstColumn    = splitPaneViewModel.FirstColumn;
         _beView.VisibleColumns = splitPaneViewModel.VisibleColumns;
     }
 }
 /// <summary>
 /// This targets a view for commands.
 /// </summary>
 /// <param name="view"></param>
 internal void SetActiveView(SplitPaneViewModel view)
 {
     _activeView = view;
 }
        /// <summary>
        /// Constructor
        /// </summary>
        public AlignmentViewModel()
        {
            Options = new RuntimeOptionsViewModel();

            _isScreenSplit = false;
            _rightPaneSize = Double.PositiveInfinity;

            SplitScreenCommand    = new DelegatingCommand(() => IsScreenSplit = !IsScreenSplit);
            ShowOptionsCommand    = new DelegatingCommand(OnShowOptions);
            ShowBirdsEyeView      = new DelegatingCommand(OnShowBev);
            MakeReferenceSequence = new DelegatingCommand <AlignmentEntityViewModel>(OnMakeReferenceSequence);
            FlipGrouping          = new DelegatingCommand(() => IsGrouped = !IsGrouped, () => SupportsGrouping);
            GotoColumn            = new DelegatingCommand(OnGotoColumn);
            GotoRow                   = new DelegatingCommand(OnGotoRow);
            GotoRefColumn             = new DelegatingCommand(OnGotoRefColumn, () => HasReferenceSequence);
            FindByName                = new DelegatingCommand(OnFindByName);
            JumpNextNucleotide        = new DelegatingCommand(OnGotoNextNucleotide, () => FocusedRow != null && FocusedColumnIndex < TotalColumns - 1);
            JumpPreviousNucleotide    = new DelegatingCommand(OnGotoPreviousNucleotide, () => FocusedRow != null && FocusedColumnIndex > 0);
            JumpNextRefNucleotide     = new DelegatingCommand(OnGotoNextRefNucleotide, () => FocusedRow != null && FocusedColumnIndex < TotalColumns - 1 && HasReferenceSequence);
            JumpPreviousRefNucleotide = new DelegatingCommand(OnGotoPreviousRefNucleotide, () => FocusedRow != null && FocusedColumnIndex > 0 && HasReferenceSequence);
            ShiftFocusLeft            = new DelegatingCommand(OnShiftFocusLeft, () => FocusedRow != null);
            ShiftFocusRight           = new DelegatingCommand(OnShiftFocusRight, () => FocusedRow != null);
            FindByTaxonomy            = new DelegatingCommand(OnFindByTaxonomy, () => IsGrouped);

            OptionsMenu.Add(new MenuItem("Change _View Options")
            {
                Command = ShowOptionsCommand, GestureText = "Ctrl+O"
            });
            _groupByMenuItem = new MenuItem("Group By Taxonomy")
            {
                Command = FlipGrouping, IsChecked = IsGrouped, GestureText = "Ctrl+G"
            };
            OptionsMenu.Add(_groupByMenuItem);

            _splitScreenMenuItem = new MenuItem("Split Screen View")
            {
                Command = SplitScreenCommand, IsChecked = IsScreenSplit, GestureText = "Ctrl+S"
            };
            ViewMenu.Add(_splitScreenMenuItem);
            ViewMenu.Add(new MenuItem("_Taxonomy Browser")
            {
                Command = FindByTaxonomy, GestureText = "Ctrl+T"
            });
            ViewMenu.Add(new MenuItem("Birds-Eye Viewer")
            {
                Command = ShowBirdsEyeView, GestureText = "Ctrl+B"
            });

            EditMenu.Add(new MenuItem("Jump To _Column")
            {
                Command = GotoColumn, GestureText = "Ctrl+C"
            });
            EditMenu.Add(new MenuItem("Jump To _Row")
            {
                Command = GotoRow, GestureText = "Ctrl+R"
            });
            EditMenu.Add(new MenuItem());
            EditMenu.Add(new MenuItem("Jump To Previous Nucelotide")
            {
                Command = JumpPreviousNucleotide, GestureText = "F2"
            });
            EditMenu.Add(new MenuItem("Jump To Next Nucelotide")
            {
                Command = JumpNextNucleotide, GestureText = "F3"
            });
            EditMenu.Add(new MenuItem());
            EditMenu.Add(new MenuItem("Jump To Reference Nucelotide")
            {
                Command = GotoRefColumn, GestureText = "Ctrl+N"
            });
            EditMenu.Add(new MenuItem("Jump To Previous Reference Nucelotide")
            {
                Command = JumpPreviousRefNucleotide, GestureText = "Ctrl+F2"
            });
            EditMenu.Add(new MenuItem("Jump To Next Reference Nucelotide")
            {
                Command = JumpNextRefNucleotide, GestureText = "Ctrl+F3"
            });
            EditMenu.Add(new MenuItem());
            EditMenu.Add(new MenuItem("Find By _Name")
            {
                Command = FindByName, GestureText = "Ctrl+F"
            });

            NucleotideColorSelector = new NucleotideColorSelector(this, Options);
            _leftView  = new SplitPaneViewModel(this);
            _rightView = new SplitPaneViewModel(this);

            // Set the intial view
            SetActiveView(_leftView);
        }