Integrating help in a WPF application

后端 未结 2 940
别跟我提以往
别跟我提以往 2020-12-13 21:25

what are the possible approaches to integrate local (so not on-line) help in a WPF application? It would be more like a manual, but I would like to integrate it in some way.

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-13 22:11

    I had a similar need except I only needed to wire up the F1 key to our existing Help code.

    I ended up pulling a mix of about 5 different StackOverflow pages so I'm putting it here in case someone else has a similar need.

    In my MainWindow.xaml I added a KeyBinding in inputBindings to wire the F1 to an ICommand:

    
        (other bindings here...)
        
    
    

    Then in my MainWindowViewModel.cs I added this ICommand which calls my existing Help code.

        private ICommand _showHelpCommand;
        public ICommand ShowHelpCommand
        {
            get
            {
                return _showHelpCommand ??
                       (_showHelpCommand = new RelayCommand(p => DisplayCREHelp(), p => true));
            }
        }
    

    I hope this helps anyone with a similar issue and I didn't think it was worth it's own thread. Cheers.

提交回复
热议问题