From 45ebf1f2b614987ce28614af430fa4a81d245a2a Mon Sep 17 00:00:00 2001 From: hsc Date: Mon, 10 Nov 2025 15:46:29 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=85=A8=E5=B1=80=E5=8F=98?= =?UTF-8?q?=E9=87=8F=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- BOB/App.xaml | 61 +------ BOB/GlobalVariables.cs | 16 +- BOB/Models/StepModel.cs | 40 ++--- BOB/Resources/Styles/WindowStyle.xaml | 2 + BOB/ViewModels/CommandTreeViewModel.cs | 6 +- .../Dialogs/DeviceSettingViewModel.cs | 20 ++- .../Dialogs/ParameterSettingViewModel.cs | 29 +++- BOB/ViewModels/MainViewModel.cs | 2 +- BOB/ViewModels/ParametersManagerViewModel.cs | 112 +++++++++---- BOB/ViewModels/ShellViewModel.cs | 154 +++++++++++++++++- BOB/ViewModels/SingleStepEditViewModel.cs | 9 +- BOB/ViewModels/StepsManagerViewModel.cs | 28 +++- BOB/Views/CommandTree.xaml | 12 +- BOB/Views/Dialogs/DeviceSetting.xaml | 8 + BOB/Views/Dialogs/ParameterSetting.xaml | 14 +- BOB/Views/MainView.xaml | 1 + BOB/Views/MainView.xaml.cs | 8 +- BOB/Views/ParametersManager.xaml | 8 +- BOB/Views/ShellView.xaml | 19 ++- BOB/Views/ShellView.xaml.cs | 3 +- BOB/Views/SingleStepEdit.xaml | 15 +- Logger/LoggerHelper.cs | 2 +- 22 files changed, 399 insertions(+), 170 deletions(-) diff --git a/BOB/App.xaml b/BOB/App.xaml index e8fe893..734f9df 100644 --- a/BOB/App.xaml +++ b/BOB/App.xaml @@ -25,66 +25,7 @@ - - + diff --git a/BOB/GlobalVariables.cs b/BOB/GlobalVariables.cs index f729377..9f54bb4 100644 --- a/BOB/GlobalVariables.cs +++ b/BOB/GlobalVariables.cs @@ -9,13 +9,13 @@ namespace BOB { public class GlobalVariables { - public ProgramModel Program = new(); - public bool IsAdmin=true; - public String UserName="hsc"; - public String Title = "主程序"; - public string CurrentFilePath; - public StepModel SelectedStep; - public ParameterModel SelectedParameter; - public DeviceModel SelectedDevice; + public ProgramModel Program { get; set; } = new(); + public bool IsAdmin { get; set; } = true; + public String UserName { get; set; } = "hsc"; + public String Title { get; set; } = "主程序"; + public string CurrentFilePath { get; set; } + public StepModel SelectedStep { get; set; } + public ParameterModel SelectedParameter { get; set; } + public DeviceModel SelectedDevice { get; set; } } } diff --git a/BOB/Models/StepModel.cs b/BOB/Models/StepModel.cs index 886596b..6397e9c 100644 --- a/BOB/Models/StepModel.cs +++ b/BOB/Models/StepModel.cs @@ -39,7 +39,7 @@ namespace BOB.Models #endregion private Guid _id = Guid.NewGuid(); - [JsonIgnore] // 添加 JsonIgnore + public Guid ID { get => _id; @@ -47,7 +47,7 @@ namespace BOB.Models } private bool _isUsed = true; - [JsonIgnore] // 添加 JsonIgnore + public bool IsUsed { get => _isUsed; @@ -55,7 +55,7 @@ namespace BOB.Models } private int _index; - [JsonIgnore] // 添加 JsonIgnore + public int Index { get => _index; @@ -63,7 +63,7 @@ namespace BOB.Models } private string? _name; - [JsonIgnore] // 添加 JsonIgnore + public string? Name { get => _name; @@ -71,7 +71,7 @@ namespace BOB.Models } private string? _stepType; - [JsonIgnore] // 添加 JsonIgnore + public string? StepType { get => _stepType; @@ -79,7 +79,7 @@ namespace BOB.Models } private MethodModel? _method; - [JsonIgnore] // 添加 JsonIgnore + public MethodModel? Method { get => _method; @@ -87,7 +87,7 @@ namespace BOB.Models } private ProgramModel? _subProgram; - [JsonIgnore] // 添加 JsonIgnore + public ProgramModel? SubProgram { get => _subProgram; @@ -95,15 +95,15 @@ namespace BOB.Models } private int? _loopCount; - [JsonIgnore] // 添加 JsonIgnore + public int? LoopCount { get => _loopCount; set => SetProperty(ref _loopCount, value); } - + [JsonIgnore] private int? _currentLoopCount; - [JsonIgnore] // 添加 JsonIgnore + [JsonIgnore] public int? CurrentLoopCount { get => _currentLoopCount; @@ -111,23 +111,23 @@ namespace BOB.Models } private Guid? _loopStartStepId; - [JsonIgnore] // 添加 JsonIgnore + public Guid? LoopStartStepId { get => _loopStartStepId; set => SetProperty(ref _loopStartStepId, value); } - + [JsonIgnore] private int _result = -1; - [JsonIgnore] // 添加 JsonIgnore + [JsonIgnore] public int Result { get => _result; set => SetProperty(ref _result, value); } - + [JsonIgnore] private int? _runTime; - [JsonIgnore] // 添加 JsonIgnore + [JsonIgnore] public int? RunTime { get => _runTime; @@ -135,7 +135,7 @@ namespace BOB.Models } private string? _okExpression; - [JsonIgnore] // 添加 JsonIgnore + public string? OKExpression { get => _okExpression; @@ -143,7 +143,7 @@ namespace BOB.Models } private string _gotoSettingString = ""; - [JsonIgnore] // 添加 JsonIgnore + public string GotoSettingString { get => _gotoSettingString; @@ -151,7 +151,7 @@ namespace BOB.Models } private Guid? _okGotoStepID; - [JsonIgnore] // 添加 JsonIgnore + public Guid? OKGotoStepID { get => _okGotoStepID; @@ -159,7 +159,7 @@ namespace BOB.Models } private Guid? _ngGotoStepID; - [JsonIgnore] // 添加 JsonIgnore + public Guid? NGGotoStepID { get => _ngGotoStepID; @@ -167,7 +167,7 @@ namespace BOB.Models } private string? _description; - [JsonIgnore] // 添加 JsonIgnore + public string? Description { get => _description; diff --git a/BOB/Resources/Styles/WindowStyle.xaml b/BOB/Resources/Styles/WindowStyle.xaml index 3bec5ec..393226b 100644 --- a/BOB/Resources/Styles/WindowStyle.xaml +++ b/BOB/Resources/Styles/WindowStyle.xaml @@ -5,6 +5,8 @@ TargetType="Window"> + new { x, i }) + .FirstOrDefault(p => p.x.ID == _globalVariables.SelectedDevice.ID)?.i; + if (index.HasValue) + { + Program.Devices[index.Value] = Device; + } + } + RequestClose.Invoke(ButtonResult.OK); } private void Cancel() { - RequestClose.Invoke(); + RequestClose.Invoke(ButtonResult.No); } #region Prism Dialog 规范 public bool CanCloseDialog() @@ -183,7 +199,7 @@ namespace BOB.ViewModels.Dialogs } else { - Device = _globalVariables.SelectedDevice; + Device = new DeviceModel(_globalVariables.SelectedDevice); IsAdd = false; } } diff --git a/BOB/ViewModels/Dialogs/ParameterSettingViewModel.cs b/BOB/ViewModels/Dialogs/ParameterSettingViewModel.cs index 1786512..93dec73 100644 --- a/BOB/ViewModels/Dialogs/ParameterSettingViewModel.cs +++ b/BOB/ViewModels/Dialogs/ParameterSettingViewModel.cs @@ -1,4 +1,5 @@ using BOB.Models; +using SqlSugar; using System; using System.Collections.Generic; using System.Collections.ObjectModel; @@ -79,12 +80,29 @@ namespace BOB.ViewModels.Dialogs private void Save() { + if (Mode == "ADD") + { + Program.Parameters.Add(Parameter); + _globalVariables.SelectedParameter = Parameter; + } + else + { + var index = Program.Parameters + .Select((x, i) => new { x, i }) + .FirstOrDefault(p => p.x.ID == _globalVariables.SelectedParameter.ID)?.i; + if (index.HasValue) + { + Program.Parameters[index.Value] = Parameter; + } + } + + RequestClose.Invoke(ButtonResult.OK); } private void Cancel() { - RequestClose.Invoke(); + RequestClose.Invoke(ButtonResult.No); } #region Prism Dialog 规范 public bool CanCloseDialog() @@ -100,8 +118,15 @@ namespace BOB.ViewModels.Dialogs public void OnDialogOpened(IDialogParameters parameters) { Program=_globalVariables.Program; - Parameter = _globalVariables.SelectedParameter; Mode = parameters.GetValue("Mode"); + if (Mode == "ADD") + { + Parameter = new(); + } + else + { + Parameter = new ParameterModel(_globalVariables.SelectedParameter); + } } #endregion } diff --git a/BOB/ViewModels/MainViewModel.cs b/BOB/ViewModels/MainViewModel.cs index 05c7c4f..5712048 100644 --- a/BOB/ViewModels/MainViewModel.cs +++ b/BOB/ViewModels/MainViewModel.cs @@ -32,7 +32,7 @@ namespace BOB.ViewModels _dialogService = dialogService; _eventAggregator = eventAggregator; testcommand = new DelegateCommand(test); - + } private void test() { diff --git a/BOB/ViewModels/ParametersManagerViewModel.cs b/BOB/ViewModels/ParametersManagerViewModel.cs index e6a2fc2..1115bad 100644 --- a/BOB/ViewModels/ParametersManagerViewModel.cs +++ b/BOB/ViewModels/ParametersManagerViewModel.cs @@ -1,4 +1,5 @@ using BOB.Models; +using Common.PubEvent; using MaterialDesignThemes.Wpf; using System; using System.Collections.Generic; @@ -12,7 +13,7 @@ using System.Xml; namespace BOB.ViewModels { - public class ParametersManagerViewModel:BindableBase,IDialogAware + public class ParametersManagerViewModel:BindableBase { #region 属性 private ProgramModel _program; @@ -25,18 +26,30 @@ namespace BOB.ViewModels public ParameterModel SelectedParameter { get => _SelectedParameter; - set => SetProperty(ref _SelectedParameter, value); + set + { + if (SetProperty(ref _SelectedParameter, value)) + { + _globalVariables.SelectedParameter = value; + } + } } private DeviceModel _SelectedDevice; public DeviceModel SelectedDevice { get => _SelectedDevice; - set => SetProperty(ref _SelectedDevice, value); + set + { + if (SetProperty(ref _SelectedDevice, value)) + { + _globalVariables.SelectedDevice = value; + } + } } #endregion - public DialogCloseListener RequestClose { get; set; } - GlobalVariables _GlobalVariables { get; set; } - IDialogService _dialogService { get; set; } + private GlobalVariables _globalVariables { get; set; } + private IDialogService _dialogService { get; set; } + private IEventAggregator _eventAggregator { get; set; } public ICommand ParameterAddCommand { get; set; } public ICommand ParameterEditCommand { get; set; } public ICommand ParameterDeleteCommand { get; set; } @@ -46,11 +59,12 @@ namespace BOB.ViewModels - public ParametersManagerViewModel(GlobalVariables GlobalVariables,IDialogService dialogService) + public ParametersManagerViewModel(GlobalVariables GlobalVariables,IDialogService dialogService,IEventAggregator eventAggregator) { - _GlobalVariables = GlobalVariables; - _dialogService= dialogService; - Program = _GlobalVariables.Program; + _globalVariables = GlobalVariables; + _eventAggregator= eventAggregator; + _dialogService = dialogService; + Program = _globalVariables.Program; ParameterAddCommand = new DelegateCommand(ParameterAdd); ParameterEditCommand = new DelegateCommand(ParameterEdit); ParameterDeleteCommand = new DelegateCommand(ParameterDelete); @@ -64,16 +78,27 @@ namespace BOB.ViewModels private void DeviceDelete() { - + Program.Devices.Remove(SelectedDevice); } private void DeviceEdit() { var param = new DialogParameters { - { "Mode", _GlobalVariables.SelectedDevice==null?"ADD":"Edit" } + { "Mode", SelectedDevice==null?"ADD":"Edit" } }; - _dialogService.ShowDialog("DeviceSetting", param); + _dialogService.ShowDialog("DeviceSetting", param, (r) => + { + if (r.Result == ButtonResult.OK) + { + + } + else + { + + } + _eventAggregator.GetEvent().Publish(false); + }); } @@ -83,21 +108,44 @@ namespace BOB.ViewModels { { "Mode", "ADD" } }; - _dialogService.ShowDialog("DeviceSetting", param); + _eventAggregator.GetEvent().Publish(true); + _dialogService.ShowDialog("DeviceSetting", param, (r) => + { + if (r.Result == ButtonResult.OK) + { + + } + else + { + + } + _eventAggregator.GetEvent().Publish(false); + }); } private void ParameterDelete() { - + Program.Parameters.Remove(SelectedParameter); } private void ParameterEdit() { var param = new DialogParameters { - { "Mode", _GlobalVariables.SelectedParameter==null?"ADD":"Edit" } + { "Mode",SelectedParameter==null?"ADD":"Edit" } }; - _dialogService.ShowDialog("ParameterSetting", param); + _dialogService.ShowDialog("ParameterSetting", param, (r) => + { + if (r.Result == ButtonResult.OK) + { + + } + else + { + + } + _eventAggregator.GetEvent().Publish(false); + }); } private void ParameterAdd() @@ -106,24 +154,20 @@ namespace BOB.ViewModels { { "Mode", "ADD" } }; - _dialogService.ShowDialog("ParameterSetting", param); - } - #endregion - #region Prism Dialog 规范 - public bool CanCloseDialog() - { - return true; - } - - public void OnDialogClosed() - { - - } - - public void OnDialogOpened(IDialogParameters parameters) - { - + _dialogService.ShowDialog("ParameterSetting", param, (r) => + { + if (r.Result == ButtonResult.OK) + { + + } + else + { + + } + _eventAggregator.GetEvent().Publish(false); + }); } #endregion + } } diff --git a/BOB/ViewModels/ShellViewModel.cs b/BOB/ViewModels/ShellViewModel.cs index b68d966..fa049cf 100644 --- a/BOB/ViewModels/ShellViewModel.cs +++ b/BOB/ViewModels/ShellViewModel.cs @@ -1,15 +1,20 @@ -using BOB.Views; +using BOB.Models; +using BOB.Views; using Common.PubEvents; using Logger; using MaterialDesignThemes.Wpf; +using Microsoft.Win32; +using Newtonsoft.Json; using System; using System.Collections.Generic; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Documents; using System.Windows.Input; +using System.Windows.Media; namespace BOB.ViewModels { @@ -34,6 +39,11 @@ namespace BOB.ViewModels public ICommand RunSingleCommand { get; set; } public ICommand ResotrationCommand { get; set; } public ICommand StopCommand { get; set; } + public ICommand SaveAsCommand { get; set; } + public ICommand SaveCommand { get; set; } + public ICommand OpenCommand { get; set; } + public ICommand NewCommand { get; set; } + public ICommand SetDefaultCommand { get; set; } #endregion private IEventAggregator _eventAggregator; @@ -46,28 +56,153 @@ namespace BOB.ViewModels MinimizeCommand = new DelegateCommand(MinimizeWindow); MaximizeCommand = new DelegateCommand(MaximizeWindow); CloseCommand = new DelegateCommand(CloseWindow); - RunningCommand = new DelegateCommand(Running); - RunSingleCommand = new DelegateCommand(RunSingle); - ResotrationCommand = new DelegateCommand(Resotration); - StopCommand = new DelegateCommand(Stop); + RunningCommand = new DelegateCommand(Running); + RunSingleCommand = new DelegateCommand(RunSingle); + ResotrationCommand = new DelegateCommand(Resotration); + StopCommand = new DelegateCommand(Stop); + NewCommand = new DelegateCommand(New); + OpenCommand = new DelegateCommand(Open); + SaveAsCommand = new DelegateCommand(SaveAs); + SaveCommand = new DelegateCommand(Save); + SetDefaultCommand = new DelegateCommand(SetDefault); + } + #region ToolBar命令 + private void SetDefault() + { + if(_globalVariables.CurrentFilePath!=null) + { + SystemConfig.Instance.DefaultSubProgramFilePath = _globalVariables.CurrentFilePath; + } + } + private void New() + { + _globalVariables.CurrentFilePath = null; + _globalVariables.Program = new(); } - private void Stop(Window window) + private void Open() + { + try + { + var openFileDialog = new OpenFileDialog + { + Filter = "BOB程序文件|*.bob|所有文件|*.*", + Title = "打开程序", + InitialDirectory = @"D:\BOB\子程序" + }; + + if (openFileDialog.ShowDialog() == true) + { + string filePath = openFileDialog.FileName; + + // 读取 JSON 文件内容 + string json = File.ReadAllText(filePath); + + // 反序列化为 ProgramModel + var program = JsonConvert.DeserializeObject(json); + + if (program != null) + { + _globalVariables.Program = program; + _globalVariables.CurrentFilePath = filePath; + + LoggerHelper.SuccessWithNotify($"成功打开文件: {filePath}"); + } + else + { + LoggerHelper.WarnWithNotify($"文件内容格式不正确: {filePath}"); + } + } + } + catch (Exception ex) + { + LoggerHelper.ErrorWithNotify($"打开文件失败: {ex.Message}"); + } + } + + + private void SaveAs() + { + string defaultPath = @"D:\BOB\子程序"; + + // 如果目录不存在,可以自动创建 + if (!Directory.Exists(defaultPath)) + Directory.CreateDirectory(defaultPath); + + var saveFileDialog = new SaveFileDialog + { + Filter = "BOB程序文件|*.bob|所有文件|*.*", + Title = "另存为", + FileName = "NewProgram.bob", + InitialDirectory = defaultPath // ✅ 默认打开这个文件夹 + }; + if (saveFileDialog.ShowDialog() == true) + { + _globalVariables.CurrentFilePath = saveFileDialog.FileName; + SaveProgramToFile(_globalVariables.CurrentFilePath); + } + + // 记录日志 + LoggerHelper.InfoWithNotify($"{_globalVariables.UserName} 另存为文件成功: {saveFileDialog.FileName}"); + + } + private void SaveProgramToFile(string filePath) + { + try + { + var tmp = ClearDeviceParameterValue(_globalVariables.Program); + string json = JsonConvert.SerializeObject(tmp, Formatting.Indented); + File.WriteAllText(filePath, json); + LoggerHelper.SuccessWithNotify($"程序已保存: {filePath}"); + } + catch (Exception ex) + { + LoggerHelper.ErrorWithNotify($"保存文件失败: {ex.Message}"); + } + } + private ProgramModel ClearDeviceParameterValue(ProgramModel program) + { + var tmp = new ProgramModel(program); + foreach (var device in tmp.Devices) + { + tmp.Parameters.Remove(tmp.Parameters.First(x => x.ID == device.ParameterID)); + } + foreach (var step in tmp.StepCollection) + { + if (step.SubProgram != null) + { + step.SubProgram = ClearDeviceParameterValue(step.SubProgram); + } + } + return tmp; + } + + private void Save() + { + if(_globalVariables.CurrentFilePath == null) + { + SaveAs(); + return; + } + SaveProgramToFile(_globalVariables.CurrentFilePath); + LoggerHelper.InfoWithNotify(_globalVariables.UserName + "保存文件成功"); + } + private void Stop() { LoggerHelper.InfoWithNotify(_globalVariables.UserName+"执行停止命令"); } - private void Resotration(Window window) + private void Resotration() { LoggerHelper.InfoWithNotify(_globalVariables.UserName + "执行复位命令"); } - private void RunSingle(Window window) + private void RunSingle() { LoggerHelper.InfoWithNotify(_globalVariables.UserName + "执行单步执行命令"); } - private void Running(Window window) + private void Running() { LoggerHelper.InfoWithNotify(_globalVariables.UserName + "执行运行命令"); } @@ -94,5 +229,6 @@ namespace BOB.ViewModels { window?.Close(); } + #endregion } } diff --git a/BOB/ViewModels/SingleStepEditViewModel.cs b/BOB/ViewModels/SingleStepEditViewModel.cs index 4f97fb6..f560730 100644 --- a/BOB/ViewModels/SingleStepEditViewModel.cs +++ b/BOB/ViewModels/SingleStepEditViewModel.cs @@ -42,18 +42,23 @@ namespace BOB.ViewModels private void DisposeSelectedStep(Guid id) { + if (SelectedStep == null) return; if(id== SelectedStep.ID) SelectedStep = null; } private void CancelEdit() { - + SelectedStep = null; } private void SaveStep() { - + if (SelectedStep == null || (SelectedStep.Method == null && SelectedStep.SubProgram == null)) + { + return; + } + } private void EditSingleSetp() diff --git a/BOB/ViewModels/StepsManagerViewModel.cs b/BOB/ViewModels/StepsManagerViewModel.cs index 6a31b34..8303662 100644 --- a/BOB/ViewModels/StepsManagerViewModel.cs +++ b/BOB/ViewModels/StepsManagerViewModel.cs @@ -16,25 +16,35 @@ namespace BOB.ViewModels public class StepsManagerViewModel:BindableBase { #region 属性 + private string _Title; public string Title { - get => _globalVariables.Title; - set => SetProperty(ref _globalVariables.Title, value); + get => _Title; + set => SetProperty(ref _Title, value); } + private StepModel _SelectedStep; public StepModel SelectedStep { - get => _globalVariables.SelectedStep; - set => SetProperty(ref _globalVariables.SelectedStep, value); + get => _SelectedStep; + set + { + if (SetProperty(ref _SelectedStep, value)) + { + _globalVariables.SelectedStep = value; + } + } } + private ProgramModel _Program; public ProgramModel Program { - get => _globalVariables.Program; - set => SetProperty(ref _globalVariables.Program, value); + get => _Program; + set => SetProperty(ref _Program, value); } + private bool _IsAdmin; public bool IsAdmin { - get => _globalVariables.IsAdmin; - set => SetProperty(ref _globalVariables.IsAdmin, value); + get => _IsAdmin; + set => SetProperty(ref _IsAdmin, value); } GlobalVariables _globalVariables { get; set; } private List tmpCopyList = new List(); @@ -49,6 +59,8 @@ namespace BOB.ViewModels { _eventAggregator = eventAggregator; _globalVariables = _GlobalVariables; + IsAdmin = _globalVariables.IsAdmin; + Program = _globalVariables.Program; EditStepCommand = new DelegateCommand(EditStep); CopyStepCommand = new DelegateCommand(CopyStep); PasteStepCommand = new DelegateCommand(PasteStep); diff --git a/BOB/Views/CommandTree.xaml b/BOB/Views/CommandTree.xaml index bacef93..ffa1d2a 100644 --- a/BOB/Views/CommandTree.xaml +++ b/BOB/Views/CommandTree.xaml @@ -18,7 +18,12 @@ - + + + + + @@ -34,7 +39,8 @@ Height="25" Margin="0,0,5,0" VerticalContentAlignment="Center" - Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}"> + Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged}" + materialDesign:HintAssist.Hint="搜索内容"> @@ -45,7 +51,7 @@ + ItemsSource="{Binding InstructionTree}"> diff --git a/BOB/Views/Dialogs/DeviceSetting.xaml b/BOB/Views/Dialogs/DeviceSetting.xaml index f855325..d5493e7 100644 --- a/BOB/Views/Dialogs/DeviceSetting.xaml +++ b/BOB/Views/Dialogs/DeviceSetting.xaml @@ -5,9 +5,12 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:converters="clr-namespace:BOB.Converters" xmlns:prism="http://prismlibrary.com/" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:behavior="clr-namespace:Common.Behaviors;assembly=Common" xmlns:i="http://schemas.microsoft.com/xaml/behaviors" prism:ViewModelLocator.AutoWireViewModel="True" + Background="White" + Panel.ZIndex="1000" mc:Ignorable="d" Height="290" Width="450"> @@ -47,6 +50,7 @@ Width="85" /> @@ -75,6 +80,7 @@ VerticalAlignment="Bottom" /> + public partial class MainView : UserControl { - public MainView() + public MainView(IEventAggregator eventAggregator) { InitializeComponent(); } - + } } diff --git a/BOB/Views/ParametersManager.xaml b/BOB/Views/ParametersManager.xaml index d3e7720..7d2364d 100644 --- a/BOB/Views/ParametersManager.xaml +++ b/BOB/Views/ParametersManager.xaml @@ -4,10 +4,10 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:prism="http://prismlibrary.com/" + xmlns:converters="clr-namespace:BOB.Converters" xmlns:sys="clr-namespace:System;assembly=mscorlib" prism:ViewModelLocator.AutoWireViewModel="True" mc:Ignorable="d"> - IsVisible + + @@ -34,7 +36,7 @@ diff --git a/BOB/Views/ShellView.xaml b/BOB/Views/ShellView.xaml index 28f13d1..db79983 100644 --- a/BOB/Views/ShellView.xaml +++ b/BOB/Views/ShellView.xaml @@ -86,15 +86,20 @@ Foreground="White" /> + Foreground="Black" + Command="{Binding NewCommand}" /> + Foreground="Black" + Command="{Binding OpenCommand}" /> + Foreground="Black" + Command="{Binding SaveAsCommand}" /> + Foreground="Black" + Command="{Binding SetDefaultCommand}" /> @@ -234,6 +239,12 @@ + diff --git a/BOB/Views/ShellView.xaml.cs b/BOB/Views/ShellView.xaml.cs index f76c4cc..05cf64a 100644 --- a/BOB/Views/ShellView.xaml.cs +++ b/BOB/Views/ShellView.xaml.cs @@ -34,9 +34,8 @@ namespace BOB.Views private void ShowOverlay(bool arg) { - DialogHost.IsOpen = arg; + Overlay.Visibility = arg ? Visibility.Visible : Visibility.Collapsed; } - private void ShowWaiting(bool arg) { DialogHost.IsOpen = arg; diff --git a/BOB/Views/SingleStepEdit.xaml b/BOB/Views/SingleStepEdit.xaml index d03e6f8..c8078be 100644 --- a/BOB/Views/SingleStepEdit.xaml +++ b/BOB/Views/SingleStepEdit.xaml @@ -43,7 +43,7 @@