Example #1
0
        public void Initialise(IMainWindowPresenter presenter)
        {
            if (!_initialised && presenter is IMainWindowPresenter)
            {
                _presenter = presenter;

                if (_includeHeadersOnCopyCheckBox.IsChecked != _presenter.IncludeHeadersOnRowCopy)
                {
                    _includeHeadersOnCopyCheckBox.IsChecked = _presenter.IncludeHeadersOnRowCopy;

                    SetHeaderCopyBehaviour(_includeHeadersOnCopyCheckBox.IsChecked());
                }

                _includeHeadersOnCopyCheckBox.CommandParameter = _presenter;
                _includeHeadersOnCopyCheckBox.Command          = _presenter.GetCommand(ECommandName.SwitchIncludeHeadersOnRowCopyFlag);

                _initialised = true;
            }
        }
        private void InitialiseContextMenu()
        {
            var contextMenu      = new ContextMenu();
            var wikiLinkMenuItem = new MenuItem
            {
                IsCheckable      = false,
                StaysOpenOnClick = false,
                Header           = ApplicationHelpers.LocalisationManager.GetLocalisedString(ELocalisationKey.GoToWiki),
                Tag = Vehicle,
                CommandParameter = _presenter,
                Command          = _presenter.GetCommand(ECommandName.GoToWiki),
            };

            wikiLinkMenuItem.Click += OnContextMenuItemClick;

            contextMenu.Items.Add(wikiLinkMenuItem);

            _border.ContextMenu = contextMenu;
        }