this TView view, TViewModel?viewModel, Expression <Func <TViewModel, TVMProp?> > vmProperty, Expression <Func <TView, TVProp> > viewProperty, IObservable <TDontCare>?signalViewUpdate, object?conversionHint = null, IBindingTypeConverter?vmToViewConverterOverride = null, IBindingTypeConverter?viewToVMConverterOverride = null, TriggerUpdate triggerUpdate = TriggerUpdate.ViewToViewModel)
private void Update(EvaluationContext context) { var triggerUpdate = TriggerUpdate.GetValue(context); var filepath = Filepath.GetValue(context); try { Result.Value = File.ReadAllText(filepath); } catch (Exception e) { Log.Error($"Failed to read file {filepath}:" + e.Message); } }
public void ParallaxUpdate(Vector2 change) { var speed = new Vector2( moveSpeed.Value.x * _relativeSpeed.Value.x, moveSpeed.Value.y * _relativeSpeed.Value.y); var pos = transform.position; pos.x += change.x * speed.x; pos.y += change.y * speed.y; transform.position = pos; if (TriggerUpdate != null) { TriggerUpdate.Invoke(this); } }
private void Update(EvaluationContext context) { if (TriggerUpdate.GetValue(context)) { TriggerUpdate.Value = false; TriggerUpdate.TypedInputValue.Value = false; TriggerUpdate.DirtyFlag.Invalidate(); TriggerUpdate.DirtyFlag.Clear(); } var folderPath = Folder.GetValue(context); var filter = Filter.GetValue(context); var filePaths = Directory.Exists(folderPath) ? Directory.GetFiles(folderPath).ToList() : new List <string>(); Files.Value = string.IsNullOrEmpty(Filter.Value) ? filePaths : filePaths.FindAll(filepath => filepath.Contains(filter)).ToList(); }
private void Update(float dt) { if (touchpadListeners.Count > 0) { TouchpadUpdate touchUpdate = new TouchpadUpdate(); #if KEYBOARD_CONTROLS touchUpdate.TouchpadPosition = new Vector2(0f, 0f); if (Input.GetKey(KeyCode.W)) { touchUpdate.TouchpadPosition.y += 0.5f; } if (Input.GetKey(KeyCode.S)) { touchUpdate.TouchpadPosition.y -= 0.5f; } if (Input.GetKey(KeyCode.D)) { touchUpdate.TouchpadPosition.x += 0.5f; } if (Input.GetKey(KeyCode.A)) { touchUpdate.TouchpadPosition.x -= 0.5f; } touchUpdate.TouchpadClicked = Input.GetKeyDown(KeyCode.W) || Input.GetKeyDown(KeyCode.A) || Input.GetKeyDown(KeyCode.S) || Input.GetKeyDown(KeyCode.D); touchUpdate.TouchpadPressState = Input.GetKey(KeyCode.W) || Input.GetKey(KeyCode.A) || Input.GetKey(KeyCode.S) || Input.GetKey(KeyCode.D); #else // touchUpdate.TouchpadPosition = OVRInput.Get(OVRInput.Axis2D.PrimaryTouchpad); // touchUpdate.TouchpadPressState = OVRInput.Get(OVRInput.Button.PrimaryTouchpad); // touchUpdate.TouchpadClicked = OVRInput.GetDown(OVRInput.Button.PrimaryTouchpad); #endif touchpadListeners[touchpadListeners.Count - 1](touchUpdate); } if (triggerListeners.Count > 0) { TriggerUpdate triggerUpdate = new TriggerUpdate(); #if KEYBOARD_CONTROLS triggerUpdate.TriggerClicked = Input.GetKeyDown(KeyCode.I); triggerUpdate.TriggerPressState = Input.GetKey(KeyCode.I); #else // triggerUpdate.TriggerPressState = OVRInput.Get(OVRInput.Button.PrimaryIndexTrigger); // triggerUpdate.TriggerClicked = OVRInput.GetDown(OVRInput.Button.PrimaryIndexTrigger); #endif triggerListeners[triggerListeners.Count - 1](triggerUpdate); } if (backButtonListeners.Count > 0) { BackButtonUpdate backButtonUpdate = new BackButtonUpdate(); #if KEYBOARD_CONTROLS backButtonUpdate.BackButtonClicked = Input.GetKeyDown(KeyCode.Escape); backButtonUpdate.BackButtonPressState = Input.GetKey(KeyCode.Escape); #else // backButtonUpdate.BackButtonPressState = OVRInput.Get(OVRInput.Button.Back); // backButtonUpdate.BackButtonClicked = OVRInput.GetDown(OVRInput.Button.Back); #endif backButtonListeners[backButtonListeners.Count - 1](backButtonUpdate); } }