/// <summary> /// Initializes a new instance of the <see cref="RelayCommand<PingUIOperations>"/> class. /// </summary> /// <param name="operationId">The operation id.</param> /// <param name="canExecute">The can execute method. use <c>null</c> to skip the check.</param> /// <param name="beginExecute">The begin execute method. Method that should be called when execution /// completed should be specified in the <see cref="IAsyncCallContext.EndCall"/> inside the <c>beginExecute</c>.</param> public RelayCommand(UIOperations operationId, BeginAsyncOperationAction beginExecute, Predicate <object> canExecute) { this._operationId = operationId; this._canExecute = canExecute; this._execute = (prm) => { this.IsExecuting = null != beginExecute(this._asyncContext = new WinAsyncCallContext(this.OperationId, prm), EndAsyncOperation); }; }
/// <summary> /// Initializes a new instance of the <see cref="RelayCommand"/> class. /// </summary> /// <param name="execute">The delegate to execute.</param> /// <param name="canExecute">The delegate to verify if command can be executed.</param> public RelayCommand(UIOperations operationId, Action <object> execute, Predicate <object> canExecute) { this._operationId = operationId; if (execute == null) { throw new ArgumentNullException("execute", "Delegate 'execute' not specified in the constructor for operationId " + operationId.ToString()); } _execute = execute; _canExecute = canExecute; }
protected async override void OnNavigatedFrom(NavigationEventArgs e) { try { Connection.instance.isConnectionChangedEvent -= ControllerPage_ConnectionChangedEvent; base.OnNavigatedTo(e); await UninitializeVideoFeedModule(); await UninitAsync(); } catch (Exception ex) { UIOperations.ShowContentDialog("ControllerPage OnNavigatedFrom Error", ex.ToString()); } }
/// <summary> /// Initializes a new instance of the <see cref="RelayCommand"/> class. /// </summary> /// <param name="execute">The delegate to execute.</param> public RelayCommand(UIOperations operationId, Action <object> execute) : this(operationId, execute, null) { }
/// <summary> /// Initializes a new instance of the <see cref="ActionRequest"/> class. /// </summary> /// <param name="operationId">The operation id.</param> /// <param name="subject">The subject.</param> public ActionRequest(UIOperations operationId, object subject) { this.OperationId = operationId; this.Subject = subject; }