跟新颜色配置
This commit is contained in:
1 parent
45829fa267
commit
d5232c581c
7 files changed
+66
-10
No files matched your search
@@ -61,8 +61,29 @@ class Program
|
||||
Console.WriteLine("PASS: LoginViewModel -> ILoginService -> AuthApi, retry, password contract and cancellation.");
|
||||
return 0;
|
||||
}
|
||||
App app = args.Contains("--status-bar") || args.Contains("--view-lifecycle") ? new App() : new TestApp(client);
|
||||
App app = args.Contains("--status-bar") || args.Contains("--view-lifecycle") || args.Contains("--grid-style") ? new App() : new TestApp(client);
|
||||
app.InitializeComponent();
|
||||
if (args.Contains("--grid-style"))
|
||||
{
|
||||
app.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
||||
var grid = new DataGridEx { ItemsSource = new[] { new { Name = "测试用户" } } };
|
||||
grid.Columns.Add(new DataGridTextColumn { Header = "名称", Binding = new System.Windows.Data.Binding("Name") });
|
||||
var window = new Window { Content = grid, Width = 500, Height = 300, ShowInTaskbar = false };
|
||||
try
|
||||
{
|
||||
window.Show();
|
||||
grid.UpdateLayout();
|
||||
Check(grid.Template != null, "表格模板必须保留");
|
||||
Check(grid.ItemContainerGenerator.ContainerFromIndex(0) is DataGridRow, "数据行必须生成");
|
||||
grid.SelectedIndex = 0;
|
||||
grid.UpdateLayout();
|
||||
Check(ReferenceEquals(grid.SelectedRowBackground, app.FindResource("SelectedBackgroundBrush")), "主题选中背景");
|
||||
Check(ReferenceEquals(grid.SelectedRowForeground, app.FindResource("SelectedForegroundBrush")), "主题选中文字");
|
||||
Console.WriteLine("PASS: DataGridEx theme retains template, data rows and selection colors.");
|
||||
}
|
||||
finally { window.Close(); app.Shutdown(); }
|
||||
return 0;
|
||||
}
|
||||
if (args.Contains("--view-lifecycle"))
|
||||
{
|
||||
app.ShutdownMode = ShutdownMode.OnExplicitShutdown;
|
||||
|
||||
Reference in new issue
Block a user