Example #1
0
        private void tabMain_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            if (_lasttabMainSelectIndex == TabMain.SelectedIndex)
            {
                return;
            }
            _lasttabMainSelectIndex = TabMain.SelectedIndex;
            if (!LoadOk)
            {
                return;
            }
            var da1 = new DoubleAnimation(0, TabMain.ActualWidth, new Duration(new TimeSpan(0, 0, 0, 0, 100)));
            var da2 = new DoubleAnimation(0, TabMain.ActualHeight, new Duration(new TimeSpan(0, 0, 0, 0, 100)));

            switch (TabMain.SelectedIndex)
            {
            case 0:
                GridGame.BeginAnimation(FrameworkElement.WidthProperty, da1); GridGame.BeginAnimation(FrameworkElement.HeightProperty, da2);
                break;

            case 1:
                GridConfig.BeginAnimation(FrameworkElement.WidthProperty, da1); GridConfig.BeginAnimation(FrameworkElement.HeightProperty, da2);
                break;

            case 2:
                GridVersion.BeginAnimation(FrameworkElement.WidthProperty, da1); GridVersion.BeginAnimation(FrameworkElement.HeightProperty, da2);
                if (GridVersion.btnRefreshRemoteVer.IsEnabled && GridVersion.listRemoteVer.HasItems == false)
                {
                    GridVersion.RefreshVersion();
                }
                break;

            case 3:
                GridForge.BeginAnimation(FrameworkElement.WidthProperty, da1); GridForge.BeginAnimation(FrameworkElement.HeightProperty, da2);
                if (GridForge.btnReForge.IsEnabled && GridForge.treeForgeVer.HasItems == false)
                {
                    GridForge.RefreshForge();
                }
                break;

            case 4:
                GridServer.BeginAnimation(FrameworkElement.WidthProperty, da1); GridServer.BeginAnimation(FrameworkElement.HeightProperty, da2);
                if (GridServer.btnReflushServer.IsEnabled && GridServer.listServer.HasItems == false)
                {
                    GridServer.ReflushSever();
                }
                break;

            case 5:
                gridUpdateInfo.BeginAnimation(FrameworkElement.WidthProperty, da1);
                gridUpdateInfo.BeginAnimation(FrameworkElement.HeightProperty, da2);
                break;
            }
        }