Beispiel #1
0
 public DialogViewModel(string title, string message)
 {
     Title         = title;
     Message       = message;
     OkCommand     = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestEventArgs(true)));
     CancelCommand = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestEventArgs(false)));
 }
Beispiel #2
0
        public void AddPerson(object o)
        {
            IPerson person = m_personFactory.CreatePerson(Name, Address, Phone, IsActive);

            AddedPersonViewModel = m_personFactory.CreatePersonViewModel(person);
            CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true));
        }
 public UnitImportWindowViewModel(BattleInputViewModel battleInputViewModel)
 {
     _battleInputViewModel = battleInputViewModel;
     ResetCommand          = new RelayCommand(ResetWindow);
     SaveCommand           = new RelayCommand(SendToBattleInput);
     CloseCommand          = new RelayCommand(() => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
 }
Beispiel #4
0
        public YieldSelectorViewModel()
        {
            OkCommand     = new RelayCommand(P => CloseRequested?.Invoke(this, new DialogCloseRequestEventArgs(true)));
            CancelCommand = new RelayCommand(P => CloseRequested?.Invoke(this, new DialogCloseRequestEventArgs(false)));

            _minYield = 1.00;
        }
 void Ribbon_ExitClicked()
 {
     if (CloseRequested != null)
     {
         CloseRequested.Invoke();
     }
 }
 public CustomMessageBoxViewModel(string message, Icon icon)
 {
     Message         = message;
     recievedIcon    = icon;
     ImageVisibility = (recievedIcon == null) ? Visibility.Collapsed : Visibility.Visible;
     OkCommand       = new DelegateCommand(() => CloseRequested?.Invoke(this, new DialogCloseArgs(true)));
 }
        public PositionListViewModel(IDialogService dialogService, PositionListFacade positionList)
        {
            this.dialogService = dialogService;
            this.positionList  = positionList;
            positionList.LoadPositionList();
            Name = "Position List";

            #region Command Initialization
            CloseCommand            = new ActionCommand(p => CloseRequested?.Invoke(this, EventArgs.Empty));
            AddPositionCommand      = new ActionCommand(p => AddPosition());
            DeletePositionCommand   = new ActionCommand(p => DeletePosition());
            EditPositionCommand     = new ActionCommand(p => EditPosition());
            AddSizeCommand          = new ActionCommand(p => AddSize());
            DeleteSizeCommand       = new ActionCommand(p => DeleteSize());
            EditSizeCommand         = new ActionCommand(p => EditSize());
            AddIngredientCommand    = new ActionCommand(p => AddIngredient());
            DeleteIngredientCommand = new ActionCommand(p => DeleteIngredient());
            #endregion

            dataGridController = new DataGridController(positionList);

            #region Observable Collections Initialization
            Positions = new ObservableCollection <Position>();
            Sizes     = new ObservableCollection <Size>();
            #endregion
        }
Beispiel #8
0
        public LoadingTabPage(string tabTitle, DrawingBrush iconDrawingBrush, LoadingOperation operation)
        {
            _operation       = operation;
            HeaderText       = tabTitle;
            IconDrawingBrush = iconDrawingBrush;

            CancelCommand = new DelegateCommand(Close);

            operation.Completed += page =>
            {
                if (page == null)
                {
                    Close();
                    return;
                }

                Page = page;
                OnPropertyChanged(nameof(Page));
                HeaderText = page.HeaderText;
                OnPropertyChanged(nameof(HeaderText));
                IconDrawingBrush = page.IconDrawingBrush;
                OnPropertyChanged(nameof(IconDrawingBrush));
            };

            void Close()
            {
                operation.Cancel();
                CloseRequested?.Invoke();
            }
        }
 protected override void InitializeCommands()
 {
     CloseCommand = new DelegateCommand <object>(result =>
     {
         CloseRequested?.Invoke(this, result);
     });
 }
        public void SaveAccount()
        {
            AccountModel account = new AccountModel(UserName, Password, SiteName);

            //by design no validation as we will allow users to save empty rows.
            CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true, account));
        }
        public YesCancelDialogViewModel(ViewModelBase viewModelBase, string message)
        {
            _viewModelBase = viewModelBase;

            Message       = message;
            OkCommand     = new ActionCommand(_viewModelBase, p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)));
            CancelCommand = new ActionCommand(_viewModelBase, p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
        }
 private void OnInputPromptModelPromptCanceled(object id)
 {
     if (id == Id)
     {
         _selfProvider.GetInstance().PromptCanceled -= OnInputPromptModelPromptCanceled;
         ThreadUtils.RunInUiAsync(() => CloseRequested?.Invoke());
     }
 }
 public void ConfirmEditPerson(object o)
 {
     m_personViewModel.Name     = Name;
     m_personViewModel.Address  = Address;
     m_personViewModel.Phone    = Phone;
     m_personViewModel.IsActive = IsActive;
     CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true));
 }
Beispiel #14
0
        public PlayerInfoViewModel(Player currentPlayer)
        {
            CurrentPlayer = currentPlayer;

            CommandOk     = new RelayCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)), null);
            CommandCancel = new RelayCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)), null);
            //CommandCancel = new RelayCommand(CancelExecute, null);
        }
 public void RequestCloseForm(bool closeSesion = false)
 {
     TB_UserName.Text        = "";
     PB_Contraseña.Password  = "";
     TB_NUserName.Text       = "";
     PB_NContraseña.Password = "";
     CloseRequested?.Invoke(closeSesion);
 }
Beispiel #16
0
 public DialogViewModel(string message, string yes, string cancel)
 {
     Message       = message;
     YesText       = yes;
     CancelText    = cancel;
     TitleText     = "Confirm Action";
     OkCommand     = new RelayCommand(() => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)));
     CancelCommand = new RelayCommand(() => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
 }
Beispiel #17
0
 private void OkCommandExecute(object obj)
 {
     room.Number  = Number;
     room.Price   = Price;
     room.Type    = RoomType;
     room.Subtype = RoomSubtype;
     room.Size    = Size;
     CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true));
 }
Beispiel #18
0
 protected void Close(bool result)
 {
     Dispatcher?.CheckBeginInvokeOnUI(() =>
     {
         CloseRequested?.Invoke(this, result
                                 ? CloseEventArgs.Ok
                                 : CloseEventArgs.Cancel);
     });
 }
 public DyntaxaMatchingDialogViewModel(string message, string searchText, TaxonNameList search) : base(message)
 {
     SearchText = searchText;
     Result     = new ObservableCollection <Plankton>();
     this.UpdateCollection(search);
     this.SearchCommand = new RelayCommand(Search);
     this.OkCommand     = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)), param => this.canExecute);
     this.CancelCommand = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
 }
Beispiel #20
0
 private void CloseForm()
 {
     if (!EditandoTrans)
     {
         ResetTransaccionForm();
         CB_Tipo.SelectedIndex = -1;
     }
     CheckTipo();
     CloseRequested?.Invoke(parameters);
 }
Beispiel #21
0
        public ReportHoaDonViewModel(string maHD, string maKH)
        {
            idRequest = 1; // Report hóa đơn
            this.maHD = maHD;
            this.maKH = maKH;

            PayCommand = new ActionCommand(p => ahihi());

            SaveCommand   = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)));
            CancelCommand = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
        }
        public PaymentConditionViewModel(PaymentConditionSet paymentConditionSet, IUnityContainer container)
        {
            _unitOfWork             = container.Resolve <IUnitOfWork>();
            PaymentConditionWrapper = new PaymentConditionWrapper2(paymentConditionSet)
            {
                Part = 1.0 - paymentConditionSet.PaymentConditions.Sum(condition => condition.Part),
                PaymentConditionPoint = new PaymentConditionPointWrapper(_unitOfWork.Repository <PaymentConditionPoint>().GetAll().First())
            };

            OkCommand = new DelegateLogCommand(
                () =>
            {
                PaymentCondition paymentCondition = this.PaymentConditionWrapper.Model;

                //если условие новое
                if (_unitOfWork.Repository <PaymentCondition>()
                    .Find(condition => Equals(condition, paymentCondition))
                    .Any() == false)
                {
                    if (_unitOfWork.SaveEntity(paymentCondition).OperationCompletedSuccessfully)
                    {
                        this.PaymentConditionWrapper.AcceptChanges();
                        container.Resolve <IEventAggregator>().GetEvent <AfterSavePaymentConditionEvent>().Publish(paymentCondition);
                    }
                    else
                    {
                        return;
                    }
                }

                IsOk = true;
                CloseRequested?.Invoke(this, new DialogRequestCloseEventArgs(true));
            },
                () => PaymentConditionWrapper.IsValid && PaymentConditionWrapper.IsChanged);

            PaymentConditionWrapper.PropertyChanged += (sender, args) => OkCommand.RaiseCanExecuteChanged();

            SelectPaymentConditionPointCommand = new DelegateLogCommand(
                () =>
            {
                ISelectService selectService = container.Resolve <ISelectService>();
                PaymentConditionPoint point  = selectService.SelectItem(_unitOfWork.Repository <PaymentConditionPoint>().GetAll());
                if (point != null)
                {
                    this.PaymentConditionWrapper.PaymentConditionPoint = new PaymentConditionPointWrapper(point);
                }
            });

            ClearPaymentConditionPointCommand = new DelegateLogCommand(
                () =>
            {
                this.PaymentConditionWrapper.PaymentConditionPoint = null;
            });
        }
        public UserInfoDialogViewModel(MainTesterViewModel procedure)
        {
            _name = procedure.Name ?? String.Empty;
            _softwareLoadVersion = procedure.SoftwareLoadVersion ?? String.Empty;
            _programPhase        = procedure.ProgramPhase ?? String.Empty;
            _programType         = procedure.ProgramType ?? String.Empty;
            _classification      = procedure.Classification ?? String.Empty;

            SubmitCommand = new RelayCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)));
            CancelCommand = new RelayCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
        }
Beispiel #24
0
        private void CloseExecute()
        {
            if (Closed)
            {
                return;
            }

            Closed = true;
            ClosedCallback?.Invoke(this);
            CloseRequested?.Invoke(this, EventArgs.Empty);
        }
Beispiel #25
0
        /// <summary>
        /// Call this method to dismiss the dialog.
        /// The <see cref="Services.IDialogService" />
        /// implementation dismisses the dialog immediately.
        /// </summary>
        /// <param name="e">An optional event args object,
        /// which may be used to convey information to the
        /// <see cref="Services.IDialogService" /> implementation</param>
        public virtual void Close(EventArgs e = null)
        {
            CloseCalled = true;

            var synchronizationContext = Dependency.Resolve <ISynchronizationContext>();

            synchronizationContext.Send(() =>
            {
                CloseRequested?.Invoke(this, e ?? EventArgs.Empty);
            });
        }
Beispiel #26
0
        public ReportHoaDonViewModel(string maNV, int thang, int nam)
        {
            idRequest  = 2;
            this.maNV  = maNV;
            this.thang = thang;
            this.nam   = nam;

            PayCommand    = new ActionCommand(p => ahihi());
            SaveCommand   = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(true)));
            CancelCommand = new ActionCommand(p => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
        }
Beispiel #27
0
        public AddBookingDialogWindowModel(DateTime dateTime, Booking booking, IHotelSystem hotel, int roomId)
        {
            Booking     = booking;
            this.hotel  = hotel;
            this.roomId = roomId;
            InDate      = dateTime;
            OutDate     = InDate.AddDays(1);

            OkCommand     = new RelayCommand(OkCommandExecute, CanOkCommandExecute);
            CancelCommand = new RelayCommand(o => CloseRequested?.Invoke(this, new DialogCloseRequestedEventArgs(false)));
        }
Beispiel #28
0
 // TAB CLOSING COMMAND RELATED METHODS
 private void CloseTab()
 {
     if (ClosingAction())
     {
         CloseRequested?.Invoke(this, EventArgs.Empty);
     }
     else
     {
         return;
     }
 }
 void Ribbon_RepackClicked()
 {
     lock (multiBoard)
     {
         Repack r = new Repack();
         r.ShowDialog();
     }
     if (Program.Restarting && CloseRequested != null)
     {
         CloseRequested.Invoke();
     }
 }
Beispiel #30
0
        /// <summary>
        /// Creates and initializes a new instance of the Window class.
        /// </summary>
        /// <param name="parent">
        /// Parent widget which this window is created on.
        /// </param>
        /// <param name="name">
        /// Window name.
        /// </param>
        /// <param name="type">
        /// Window type.
        /// </param>
        /// <remarks>
        /// Window constructor.show window indicator, set callback
        /// when closing the window in any way outside the program control,
        /// and set callback when window rotation is changed.
        /// </remarks>
        /// <since_tizen> preview </since_tizen>
        public Window(Window parent, string name, WindowType type)
        {
            Name = name;
            Type = type;
            Realize(parent);
            IndicatorMode = IndicatorMode.Show;

            _deleteRequest       = new SmartEvent(this, "delete,request");
            _rotationChanged     = new SmartEvent(this, "wm,rotation,changed");
            _deleteRequest.On   += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty);
            _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty);
        }
Beispiel #31
0
		public void RedrawFrameGeometry (Object Sender)
			{
			CloseRequested PosWindow_CloseRequestedEntry = new CloseRequested (PosWindow_CloseRequestedCall);
//			String EntryToRefresh = LoadPicturePartsButton.Tag as String;
			if (PicturesTabControl.SelectedItem == null)
				return;
			TabItem SelectedItem = PicturesTabControl.SelectedItem as TabItem;
			String PageID = SelectedItem.Tag as String;
			Grid RootGrid = SelectedItem.Content as Grid;
			bool Found = false;
			foreach (UIElement Entry in RootGrid.Children)
				{
				if ((Entry is Canvas) == false)
					continue;
				if ((Entry as Canvas) == GraphicsSingleton.Instance.GraphicsHandler.RootCanvasForDrawingActivities)
					{
					Found = true;
					break;
					}
				}
			if (!Found)
				{
				GraphicsSingleton.Instance.GraphicsHandler.ClearRootCanvas ();
				GraphicsSingleton.Instance.GraphicsHandler.RootCanvasForDrawingActivities = null;
				RootGrid.Children.Add (GraphicsSingleton.Instance.GraphicsHandler.RootCanvasForDrawingActivities);
				}
			Border TargetBorder = RootGrid.Children [0] as Border;
			Image TargetImage = TargetBorder.Child as Image;
			RedrawInformation RedrawData = TargetImage.Tag as RedrawInformation;
			if (Sender is CVM.PositioningEntry)
				{
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer ("TableProcessing.ShowFrameGeometryButton_Click",
						"CVM.PositioningEntry.ShowFrameGeometry von CVM.PositioningEntry " + (Sender as CVM.PositioningEntry).AddOnText);
				CVM.PositioningEntry.ShowFrameGeometry (DrawingWidth, GraphicsSingleton.Instance.GraphicsHandler, RedrawData,
						SelectedItem.Content as Grid, PageID, new CVM.PositioningEntry.RedrawMeEvent (RedrawMe),
						new GraphicsSingleton.DoThisAfterContextProcessingEvent (DoThisAfterContextProcessingCall),
						new SetUIElementsEnabelingToEvent (SetUIElementsEnabelingToEventHandler),
						new ActivatePageIDEvent (ActivatePageIDEventHandler),
						new GetBeitragsDatenFromBeitragsIDEvent (GetBeitragsDatenFromBeitragsIDHandler),
						PosWindow_CloseRequestedEntry,
						new RedrawFrameGeometryEvent(RedrawFrameGeometry));
				return;
				}
			this.IsEnabled = false;
			if (ShowFrameGeometryButton.Content.ToString () == "Layout/Geometrie")
				{
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer ("TableProcessing.ShowFrameGeometryButton_Click",
						"CVM.PositioningEntry.ShowFrameGeometry mit ShowFrameGeometryButton.Content== Layout/Geometrie");
				CVM.PositioningEntry.ShowFrameGeometry (DrawingWidth, GraphicsSingleton.Instance.GraphicsHandler, RedrawData,
						SelectedItem.Content as Grid, PageID,  new CVM.PositioningEntry.RedrawMeEvent (RedrawMe),
						new GraphicsSingleton.DoThisAfterContextProcessingEvent (DoThisAfterContextProcessingCall),
						new SetUIElementsEnabelingToEvent (SetUIElementsEnabelingToEventHandler),
						new ActivatePageIDEvent (ActivatePageIDEventHandler),
						new GetBeitragsDatenFromBeitragsIDEvent (GetBeitragsDatenFromBeitragsIDHandler),
						PosWindow_CloseRequestedEntry,
						new RedrawFrameGeometryEvent (RedrawFrameGeometry));
				ShowFrameGeometryButton.Content = "Normalsicht";
				ShowFrameGeometryButton.ToolTip = "Neue Text- oder Bildrahmen können durch die rechte Maustaste angefordert werden";
				if (m_FrameProcessingContextMenuHandler == null)
					m_FrameProcessingContextMenuHandler = new ContextMenuEventHandler (SelectedItem_ContextMenuOpening);
				ShowFrameGeometryButton.ContextMenuOpening += m_FrameProcessingContextMenuHandler;
				}
			else
				{
				if (WMB.Basics.IsTestRun)
					WMB.Basics.ReportInformationToEventViewer ("TableProcessing.ShowFrameGeometryButton_Click",
						"CVM.PositioningEntry.ShowFrameGeometry mit ShowFrameGeometryButton.Content == "
							+ ShowFrameGeometryButton.Content.ToString ());
				if (ShowFrameGeometryButton.Content.ToString () == "Speichern")
					{
					DoThisAfterContextProcessingCall (this, "Refresh");
					}
				GraphicsSingleton.Instance.GraphicsHandler.ModificationRequired = true;
				GraphicsSingleton.Instance.CloseAndSaveAllPositioningWindows ();
	//			CVM.PositioningEntry.DeleteExistingFrames ();
				GraphicsSingleton.Instance.GraphicsHandler.ClearRootCanvas ();
				RedrawMe (PageID);
				ShowFrameGeometryButton.Content = "Layout/Geometrie";
				ShowFrameGeometryButton.ContextMenuOpening -= m_FrameProcessingContextMenuHandler;
				m_FrameProcessingContextMenuHandler = null;
				ShowFrameGeometryButton.ContextMenu = null;
				ShowFrameGeometryButton.ToolTip = "";
				FormatModified = false;
				}
			this.IsEnabled = true;
			}