public VMKeyboardEditable( VMContextEditable ctx, IKeyboard kb )
            : base(ctx)
        {
            _zones = new ObservableCollection<VMZoneEditable>();
            _keys = new ObservableCollection<VMKeyEditable>();
            _keyboard = kb;
            _holder = ctx;
            Model = kb;
            _keyboardModes = new ObservableCollection<VMKeyboardMode>();

            foreach( IZone zone in _keyboard.Zones )
            {
                var vmz = Context.Obtain( zone );
                // TODO: find a better way....
                if( zone.Name == "Prediction" ) Zones.Insert( 0, vmz );
                else Zones.Add( vmz );

                foreach( IKey key in zone.Keys )
                {
                    _keys.Add( Context.Obtain( key ) );
                }
            }

            RegisterEvents();

            RefreshModes();
        }
        public VMKeyModeEditable( VMContextEditable context, IKeyMode model )
            : base(context, model)
        {
            _model = model;
            _commands = new ObservableCollection<string>();

            _modeName = String.IsNullOrWhiteSpace( _model.Mode.ToString() ) ? R.DefaultMode : _model.Mode.ToString();
            _sectionName = R.ContentSection;

            foreach( var cmd in Model.OnKeyDownCommands.Commands )
            {
                _commands.Add( cmd );
            }

            foreach( var cmd in Model.OnKeyUpCommands.Commands )
            {
                _commands.Add( cmd );
            }

            foreach( var cmd in Model.OnKeyPressedCommands.Commands )
            {
                _commands.Add( cmd );
            }

            InitializeCurrentImage();

            RegisterEvents();
        }
 public VMLayoutKeyModeEditable( VMContextEditable context, ILayoutKeyMode model )
     : base(context, model)
 {
     _model = model;
     _modeName = String.IsNullOrWhiteSpace( _model.Mode.ToString() ) ? R.DefaultMode : _model.Mode.ToString();
     _sectionName = R.DesignSection;
 }
        public VMZoneEditable( VMContextEditable ctx, IZone zone )
            : base(ctx)
        {
            _ctx = ctx;
            _zone = zone;
            _keys = new CKObservableSortedArrayKeyList<VMKeyEditable, int>( k => k.Index );

            foreach( IKey key in _zone.Keys )
            {
                VMKeyEditable k = Context.Obtain( key );
                Keys.Add( k );
            }
        }
        public VMKeyModeEditable( VMContextEditable context, IKeyMode model )
            : base(context)
        {
            _model = model;
            _commands = new ObservableCollection<string>();

            foreach( var cmd in _model.OnKeyDownCommands.Commands )
            {
                _commands.Add( cmd );
            }

            foreach( var cmd in _model.OnKeyUpCommands.Commands )
            {
                _commands.Add( cmd );
            }

            foreach( var cmd in _model.OnKeyPressedCommands.Commands )
            {
                _commands.Add( cmd );
            }

            RegisterEvents();
        }
 protected VMContextElementEditable( VMContextEditable context )
 {
     _context = context;
     if( _context.SkinConfiguration != null )
         _context.SkinConfiguration.ConfigChanged += OnLayoutConfigChanged;
 }
Exemple #7
0
 public VMKeyboardMode( VMContextEditable holder, IKeyboardMode keyboardMode )
 {
     Mode = keyboardMode;
     _holder = holder;
 }
 public VMKeyModeBase( VMContextEditable context, ILayoutKeyMode model )
     : base(context)
 {
     _model = model;
     _modelMode = model.Mode;
 }
        public VMKeyEditable( VMContextEditable ctx, IKey k )
            : base(ctx)
        {
            //By default, we show the fallback.
            ShowFallback = FallbackVisibility.FallbackOnLayout | FallbackVisibility.FallbackOnKeyMode;

            _context = ctx;
            _key = k;

            _actionsOnPropertiesChanged = new Dictionary<string, ActionSequence>();

            _context = ctx;
            KeyDownCommand = new CK.Windows.App.VMCommand( () => _context.SelectedElement = this );
            _currentKeyModeModeVM = new VMKeyboardMode( _context, k.Current.Mode );
            _currentLayoutKeyModeModeVM = new VMKeyboardMode( _context, k.CurrentLayout.Current.Mode );

            _layoutKeyModes = new ObservableCollection<VMLayoutKeyModeEditable>();
            _keyModes = new ObservableCollection<VMKeyModeEditable>();

            RefreshKeyModeCollection();
            RefreshLayoutKeyModeCollection();

            GetImageSourceCache();

            RegisterEvents();
        }
 public VMLayoutKeyModeEditable( VMContextEditable context, ILayoutKeyMode model )
     : base(context)
 {
     _model = model;
 }