2017-02-18 00:15:59 +03:00
|
|
|
|
using BrightSharp.Converters;
|
|
|
|
|
|
using Diagrams;
|
2017-01-09 13:25:52 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Windows;
|
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
|
|
|
|
|
|
namespace BrightSharp.Ui.Tests
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Interaction logic for MainWindow.xaml
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
public partial class MainWindow : Window
|
|
|
|
|
|
{
|
|
|
|
|
|
public MainWindow()
|
|
|
|
|
|
{
|
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
|
SelectionBehavior.Attach(innerCanvas);
|
|
|
|
|
|
tb.Text = ThemeManager.Theme.ToString();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (Enum.IsDefined(typeof(ColorThemes), ThemeManager.Theme + 1))
|
|
|
|
|
|
{
|
|
|
|
|
|
ThemeManager.Theme = ThemeManager.Theme + 1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
ThemeManager.Theme = ColorThemes.Classic;
|
|
|
|
|
|
}
|
|
|
|
|
|
tb.Text = ThemeManager.Theme.ToString();
|
|
|
|
|
|
}
|
2017-02-18 00:15:59 +03:00
|
|
|
|
|
|
|
|
|
|
private void Button_Click_ShowCustomWindow(object sender, RoutedEventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
new CustomWindow().ShowDialog();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void DataGrid_AutoGeneratedColumns(object sender, EventArgs e)
|
|
|
|
|
|
{
|
|
|
|
|
|
var dg = (DataGrid)sender;
|
|
|
|
|
|
var stringHelper = new StringHelpConverter();
|
|
|
|
|
|
foreach (var col in dg.Columns)
|
|
|
|
|
|
{
|
|
|
|
|
|
col.Header = stringHelper.Convert(col.Header, null, "SpaceBetweenCaps", null);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-01-09 13:25:52 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|