修复文字错误,和部分配色问题
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
@@ -55,7 +57,28 @@ public partial class MainWindow
|
||||
public ICommand ToggleDetailsCommand { get; set; }
|
||||
|
||||
[RelayCommand]
|
||||
private void AddArea() { }
|
||||
private void AddArea()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
var dictionary = Application.Current.Resources;
|
||||
foreach (var res in dictionary.MergedDictionaries)
|
||||
{
|
||||
foreach (DictionaryEntry item in res)
|
||||
{
|
||||
//sb.AppendLine($"{item.Key} = {item.Value}");
|
||||
if (item.Key.ToString() == "TextPrimaryBrush")
|
||||
{
|
||||
MessageBox.Show($"TextPrimaryBrush:{item.Value}");
|
||||
}
|
||||
if (item.Key.ToString() == "TextPrimaryBrush")
|
||||
{
|
||||
MessageBox.Show($"TextSecondaryBrush:{item.Value}");
|
||||
}
|
||||
}
|
||||
}
|
||||
//输出到桌面
|
||||
//System.IO.File.WriteAllText(System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "resources.txt"), sb.ToString());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 静态数据
|
||||
@@ -278,7 +301,7 @@ public partial class MainWindow
|
||||
#region Modal 事件
|
||||
private void ShowBasicModal_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool? result = Modal.Confirm(this, "Basic Dialog", "This is a basic modal dialog.");
|
||||
bool? result = Modal.Confirm(this, "默认对话框", "默认对话框");
|
||||
if (result == true)
|
||||
{
|
||||
MessageBox.Show("User clicked OK!");
|
||||
@@ -287,7 +310,7 @@ public partial class MainWindow
|
||||
|
||||
private async void ShowAsyncModal_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bool? result = Modal.Confirm(this, "Async Dialog", "This dialog will close after a 2-second task.",
|
||||
bool? result = Modal.Confirm(this, "异步对话框", "对话框将在2s后关闭",
|
||||
async () =>
|
||||
{
|
||||
await Task.Delay(2000);
|
||||
@@ -325,20 +348,7 @@ public partial class MainWindow
|
||||
if (sender is not ToggleButton tb) return;
|
||||
|
||||
var targetMode = tb.IsChecked == true ? ThemeMode.Dark : ThemeMode.Light;
|
||||
|
||||
try
|
||||
{
|
||||
_themeAnimating = true;
|
||||
await ThemeManager.ApplyThemeAsync(targetMode, animate: true, animationDurationMs: 2000);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
System.Diagnostics.Debug.WriteLine("[ThemeToggle] " + ex);
|
||||
}
|
||||
finally
|
||||
{
|
||||
_themeAnimating = false;
|
||||
}
|
||||
await ThemeManager.ApplyThemeAsync(targetMode, animationDurationMs: 800);
|
||||
}
|
||||
|
||||
private void ColorPalette_OnClick(object sender, RoutedEventArgs e)
|
||||
|
||||
Reference in New Issue
Block a user