private void ButtonEdit_OnClick(object sender, RoutedEventArgs e)
        {
            // Get the macro from the current line.
            var macro = ((FrameworkElement)sender).DataContext as Macro;

            // Hmm, no macro.. gracefully exit.
            if (macro == null)
            {
                return;
            }

            // Set the initial text for the editor.
            var win = new MacroEditWindow
            {
                Macro = macro
            };

            // Show what macro is being edited in the status bar of the string editor window.
            win.SetStatus(macro);

            // Startup position of the dialog should be in the center of the parent window.  The
            // owner has to be set for this to work.
            win.Owner = App.MainWindow;
            win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            win.EditType = MacroEditWindow.EditTypeCode.Edit;

            // Show the string dialog
            var result = win.ShowDialog();

            //// If the result
            //if (result != null && result.Value)
            //{
            //    macro. = win.Command;
            //}
        }
        /// <summary>
        /// Creates a new macro.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void ButtonNewMacro_Click(object sender, RoutedEventArgs e)
        {
            var macro = new Macro();

            App.Settings.ProfileSettings.MacroList.Add(macro);

            // Set the initial text for the editor.
            var win = new MacroEditWindow
            {
                Macro = macro
            };

            // Show what macro is being edited in the status bar of the string editor window.
            win.SetStatus("Put the focus in the 'Macro Key' text box and press the key you want to create a macro for.");

            // Startup position of the dialog should be in the center of the parent window.  The
            // owner has to be set for this to work.
            win.Owner = App.MainWindow;
            win.WindowStartupLocation = WindowStartupLocation.CenterOwner;
            win.EditType = MacroEditWindow.EditTypeCode.Add;

            // Show the string dialog
            var result = win.ShowDialog();
        }