Files
BrightSharp.Toolkit/BrightSharp.Ui.Tests/TabbedMainWindow.xaml.cs

53 lines
1.7 KiB
C#
Raw Normal View History

using BrightSharp.Themes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
2019-06-22 11:21:54 +03:00
using System.Text.RegularExpressions;
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.Shapes;
namespace BrightSharp.Ui.Tests
{
/// <summary>
/// Interaction logic for TabbedMainWindow.xaml
/// </summary>
public partial class TabbedMainWindow : Window
{
public TabbedMainWindow()
{
InitializeComponent();
StyleNameTextBlock.Text = ThemeManager.Theme.ToString();
}
private void ChangeStyleButton_Click(object sender, RoutedEventArgs e)
{
if (Enum.IsDefined(typeof(ColorThemes), ThemeManager.Theme + 1))
ThemeManager.Theme = ThemeManager.Theme + 1;
else
ThemeManager.Theme = ColorThemes.Classic;
StyleNameTextBlock.Text = ThemeManager.Theme.ToString();
}
private void Calendar_Loaded(object sender, RoutedEventArgs e)
{
var cal = (Calendar)sender;
cal.BlackoutDates.Add(new CalendarDateRange(DateTime.Now.AddDays(-10), DateTime.Now.AddDays(-8)));
cal.DisplayDateStart = DateTime.Now.AddDays(-400);
}
2019-06-22 11:21:54 +03:00
private void DataGrid_AutoGeneratedColumns(object sender, EventArgs e)
{
var dg = (DataGrid)sender;
foreach (var col in dg.Columns)
{
col.Header = Regex.Replace(col.Header.ToString(), "([a-z])([A-Z])", "$1 $2");
}
}
}
}