public static string GetInputGestureText(InputGestureCollection gestures) { if (gestures == null) return null; List<KeyGesture> ShortCutKeys = gestures.OfType<KeyGesture>().ToList(); string ret = ""; ShortCutKeys.ForEach(item => ret += (ret.Count() != 0 ? ", " : "") + GetInputGestureText(item)); return ret == "" ? null : ret; }
public void SetGestuers(InputGestureCollection igc) { ShortCuts = new List<ShortCutData>(); foreach (var kg in igc.OfType<KeyGesture>()) { ShortCuts.Add(new ShortCutData(kg)); } }