protected void RunCommand(T key, KeyBehavior behavior) { if (commands[behavior].ContainsKey(key)) { commands[behavior][key].Execute(); } }
public void AddCommand(object key, ICommand value, KeyBehavior behavior) { if (key is T castedKey) { commands[behavior].Add(castedKey, value); } }
public MainPage() { this.InitializeComponent(); //ViewModel = (ViewModel.ViewModel)DataContext; //text.Paste += Text_Paste; //ViewModel.OnNavigatedTo(this, Frame); Key = new KeyBehavior(Content); Key.Add(new KeyAction(KeyAction.Ctrl + VirtualKey.S, e => Debug.Write("s"))); }
public void Awake() { rend = GetComponent <SpriteRenderer>(); keyBehavior = GetComponent <KeyBehavior>(); }