internal VMKeyboardSimple( VMContextSimpleBase ctx, IKeyboard kb ) : base(ctx) { Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." ); _zones = new ObservableCollection<VMZoneSimple>(); _keys = new ObservableCollection<VMKeySimple>(); _keyboard = kb; RegisterEvents(); foreach( IZone zone in _keyboard.Zones.ToList() ) { VMZoneSimple zoneVM = Context.Obtain( zone ); Zones.Add( zoneVM ); foreach( IKey key in zone.Keys ) { _keys.Add( Context.Obtain( key ) ); } } UpdateW(); UpdateH(); SafeUpdateInsideBorderColor(); UpdateHighlightBackground(); UpdateHighlightFontColor(); UpdateLoopCount(); UpdateBackgroundPath(); IsHighlightableTreeRoot = true; }
internal VMZoneSimple( VMContextSimpleBase ctx, IZone zone, int index ) : base(ctx) { Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." ); _zone = zone; _index = index; SafeUpdateLoopCount(); _keys = new CKObservableSortedArrayKeyList<VMKeySimple, int>( k => k.Index ); foreach( IKey key in _zone.Keys ) { VMKeySimple k = Context.Obtain( key ); Keys.Add( k ); } Context.Config.ConfigChanged += OnConfigChanged; }
public VMZoneSimple( VMContextSimpleBase ctx ) : base(ctx) { Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." ); _keys = new CKObservableSortedArrayKeyList<VMKeySimple, int>( k => k.Index ); }
internal VMKeySimple( VMContextSimpleBase ctx, IKey k ) : base(ctx) { Debug.Assert( Dispatcher.CurrentDispatcher == Context.NoFocusManager.ExternalDispatcher, "This method should only be called by the ExternalThread." ); _actionsOnPropertiesChanged = new Dictionary<string, ActionSequence>(); _key = k; ResetCommands(); RegisterEvents(); SafeUpdateBackground(); SafeUpdateDescription(); SafeUpdateDownLabel(); SafeUpdateFontSize(); SafeUpdateFontStyle(); SafeUpdateFontWeight(); SafeUpdateHeight(); SafeUpdateHighlightBackground(); SafeUpdateHighlightFontColor(); SafeUpdateHoverBackground(); SafeUpdateImage(); SafeUpdateIndex(); SafeUpdateIsEnabled(); SafeUpdateIsFallback(); SafeUpdateLetterColor(); SafeUpdateOpacity(); SafeUpdatePressedBackground(); SafeUpdateShowImage(); SafeUpdateShowLabel(); SafeUpdateUpLabel(); SafeUpdateVisible(); SafeUpdateWidth(); SafeUpdateX(); SafeUpdateY(); }