Exemplo n.º 1
0
        public GridZone( PanelViewModel panel )
        {
            _panel = panel;
            DataContext = panel;
            InitializeComponent();

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

                _panel.CreatePanels();
                CreateDefinitions();
                CreatePanels();
            }
        }
Exemplo n.º 2
0
        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"] ) );
        }
Exemplo n.º 3
0
 public EnterNowEventArgs( PanelViewModel panel, int currentPos )
 {
     _panel = panel;
     _currentPos = currentPos;
 }
Exemplo n.º 4
0
 public PanelViewModel( GridViewModel owner, int position, PanelViewModel parent )
     : this(owner)
 {
     _parent = parent;
     if( position > 0 ) _position = position;
 }
Exemplo n.º 5
0
 public PanelViewModel Enter()
 {
     _loop = 0;
     var newPanel = new PanelViewModel( _grid, _panels.IndexOf( Current ), this );
     OnEnterNow( new EnterNowEventArgs( newPanel, _panels.IndexOf( Current ) ) );
     return newPanel;
 }
Exemplo n.º 6
0
 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 );
     }
 }