public IFunctionReference SelectFunction(Guid?selectedFunctionId)
        {
            var functionService = _owner.GetService <IFunctionService>();

            if (functionService == null)
            {
                var messageBoxService = new MessageBoxService();

                messageBoxService.Show("No function service was provided.");

                return(null);
            }

            var functions = functionService.GetFunctions();

            var viewModel = new FunctionSelectionDialogViewModel(functions, selectedFunctionId);

            var view = new FunctionSelectionDialogView()
            {
                DataContext = viewModel,
                Owner       = WindowUtil.GetActiveWindow()
            };

            if (view.ShowDialog() == true)
            {
                return(viewModel.SelectedFunction);
            }

            return(null);
        }
        public IFunctionReference SelectFunction(Guid? selectedFunctionId)
        {
            var functionService = _owner.GetService<IFunctionService>();

            if (functionService == null)
            {
                var messageBoxService = new MessageBoxService();

                messageBoxService.Show("No function service was provided.");

                return null;
            }

            var functions = functionService.GetFunctions();

            var viewModel = new FunctionSelectionDialogViewModel(functions, selectedFunctionId);

            var view = new FunctionSelectionDialogView()
            {
                DataContext = viewModel,
                Owner = WindowUtil.GetActiveWindow()
            };

            if (view.ShowDialog() == true)
            {
                return viewModel.SelectedFunction;
            }

            return null;
        }