public GridZone( PanelViewModel panel )
        {
            _panel = panel;
            DataContext = panel;
            InitializeComponent();

            if( panel != null )
            {
                panel.EnterNow += OnEnterNow;

                _panel.CreatePanels();
                CreateDefinitions();
                CreatePanels();
            }
        }
        public GridViewModel( WindowViewModel window )
        {
            _window = window;
            var m = new PanelViewModel( this );
            _panels.Push( m );

            _timer.Tick += delegate( object s, EventArgs args )
            {
                if( Current != null )
                    Current.Switch();
                else
                    _timer.Stop();
            };
            _timer.Interval = new TimeSpan( 0, 0, 0, 0, Int32.Parse( ConfigurationManager.AppSettings["TimeToSwitch"] ) );
        }
 public EnterNowEventArgs( PanelViewModel panel, int currentPos )
 {
     _panel = panel;
     _currentPos = currentPos;
 }
 public PanelViewModel( GridViewModel owner, int position, PanelViewModel parent )
     : this(owner)
 {
     _parent = parent;
     if( position > 0 ) _position = position;
 }
 public PanelViewModel Enter()
 {
     _loop = 0;
     var newPanel = new PanelViewModel( _grid, _panels.IndexOf( Current ), this );
     OnEnterNow( new EnterNowEventArgs( newPanel, _panels.IndexOf( Current ) ) );
     return newPanel;
 }
 public void CreatePanels()
 {
     _panels.Clear();
     int nbPanels = MaxColumnByRowProperty * MaxRowProperty;
     for( int i = 0; i < nbPanels; i++ )
     {
         PanelViewModel p = new PanelViewModel( _grid, _panels.Count - 1, this );
         if( i == 0 ) p.IsActive = true;
         _panels.Add( p );
     }
 }