public ShellViewModel(IEventAggregator eventAggregator, IConfigService configService) { _eventAggregator = eventAggregator; _configService = configService; _adminInfo = _configService.AdminInfos; ConfigDisplayCommand = new DelegateCommand(ConfigDisplayExecuted); AdminLoginRequest = new GenericInteractionRequest<AdminLoginNotification>(); ConfigRequest = new GenericInteractionRequest<ConfigNotification>(); //注册消息 }
private void LoadAdminInfo() { if (!System.IO.File.Exists(Properties.Resource.AdminInfoFilePath)) { _adminInfo = new AdminInfo { Name = "admin", Password = MD5Converter.GetMD5("123456") }; _adminInfo.FilePath = Properties.Resource.AdminInfoFilePath; } else { _adminInfo = (AdminInfo)_serializer.DeSerialize(Properties.Resource.AdminInfoFilePath, typeof(AdminInfo)); } SaveAdminInfo(); }