| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using OHV.Module.Interactivity.PopUp;
- using Prism.Interactivity.InteractionRequest;
- using Prism.Ioc;
- using Prism.Modularity;
- using Prism.Mvvm;
- using Prism.Services.Dialogs;
- namespace OHV.Module.Interactivity
- {
- public class MessageController : IModule
- {
- IDialogService dialogService;
- public MessageController( IDialogService dialogService )
- {
- this.dialogService = dialogService;
- }
- public void OnInitialized( IContainerProvider containerProvider )
- {
- }
- public void RegisterTypes( IContainerRegistry containerRegistry )
- {
- containerRegistry.RegisterDialog<NotificatioinView , NotificationViewModel>();
- containerRegistry.RegisterDialog<ConfirmationPopupView , ConfirmationPopupViewModel>();
- containerRegistry.RegisterDialog<MapView , MapViewModel>();
- containerRegistry.RegisterDialog<ServoConfigView , ServoConfigViewModel>();
- containerRegistry.RegisterDialog<InOutView , InOutViewModel>();
- containerRegistry.RegisterDialog<DriveServoView , DriveServoViewModel>();
- containerRegistry.RegisterDialog<LockServoView , LockServoViewModel>();
- containerRegistry.RegisterDialog<BatteryConfigView , BatteryConfigViewModel>();
- containerRegistry.RegisterDialog<OpticalReadingConfigView , OpticalReadingConfigViewModel>();
- containerRegistry.RegisterDialog<InOutControlView , InOutControlViewModel>();
- }
- public void ShowNotificationView( string Message , bool isOK = true )
- {
- var dialogPram = new DialogParameters();
- dialogPram.Add( "message" , Message );
- dialogPram.Add( "Type" , isOK );
- this.dialogService.ShowDialog( "NotificatioinView" , dialogPram , null );
- }
- public void ShowConfirmationPopupView( string Message , Action<IDialogResult> callBack )
- {
- this.dialogService.ShowDialog( "ConfirmationPopupView" , new DialogParameters( $"message={Message}" ) , callBack );
- }
- public void ShowMapPopupView( )
- {
- this.dialogService.ShowDialog( "MapView" , new DialogParameters() , null );
- }
- public void ShowServoConfigPopupView( )
- {
- this.dialogService.ShowDialog( "ServoConfigView" , new DialogParameters() , null );
- }
- public void ShowInOutPopupView( )
- {
- this.dialogService.ShowDialog( "InOutView" , new DialogParameters() , null );
- }
- public void ShowLockPopupView( )
- {
- this.dialogService.ShowDialog( "LockServoView" , new DialogParameters() , null );
- }
- public void ShowDrivePopupView( )
- {
- this.dialogService.ShowDialog( "DriveServoView" , new DialogParameters() , null );
- }
- public void ShowBatteryPopupView( )
- {
- this.dialogService.ShowDialog( "BatteryConfigView" , new DialogParameters() , null );
- }
- public void ShowOpticalReadPopupView()
- {
- this.dialogService.ShowDialog( "OpticalReadingConfigView" , new DialogParameters() , null );
- }
- public void ShowInOutControlPopupView()
- {
- this.dialogService.ShowDialog( "InOutControlView" , new DialogParameters() , null );
- }
- }
- }
|