Views/TabControlsView.xaml.cs
(完整代码) 1KBusing System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace MahAppsMetro.Demo.Views
{
/// <summary>
/// TabControlsView.xaml 的互動邏輯
/// </summary>
public partial class TabControlsView : UserControl
{
public TabControlsView()
{
InitializeComponent();
Loaded += TabControlsView_Loaded;
}
int index = 0;
bool isLoaded = false;
private void TabControlsView_Loaded(object sender, RoutedEventArgs e)
{
if (isLoaded) return;
isLoaded = true;
Task.Factory.StartNew(new Action(() =>
{
while (true)
{
int count = 0;
Dispatcher.Invoke(new Action(() =>
{
count = tabControl1.Items.Count;
tabControl1.SelectedIndex = index;
}));
Thread.Sleep(3000);
index++;
if (index >= count) index = 0;
}
}));
}
private void tabControl1_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
index = tabControl1.SelectedIndex;
}
}
}
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。