forked from ArthurHub/HTML-Renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSampleWindow.xaml.cs
More file actions
47 lines (41 loc) · 1.25 KB
/
Copy pathSampleWindow.xaml.cs
File metadata and controls
47 lines (41 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// "Therefore those skilled at the unorthodox
// are infinite as heaven and earth,
// inexhaustible as the great rivers.
// When they come to an end,
// they begin again,
// like the days and months;
// they die and are reborn,
// like the four seasons."
//
// - Sun Tsu,
// "The Art of War"
using System.Windows;
using System.Windows.Input;
using TheArtOfDev.HtmlRenderer.Demo.Common;
using Xceed.Wpf.Toolkit.PropertyGrid;
namespace TheArtOfDev.HtmlRenderer.Demo.WPF
{
/// <summary>
/// Interaction logic for SampleWindow.xaml
/// </summary>
public partial class SampleWindow
{
public SampleWindow()
{
InitializeComponent();
_htmlLabel.Text = DemoUtils.SampleHtmlLabelText;
_htmlPanel.Text = DemoUtils.SampleHtmlPanelText;
_propertyGrid.SelectedObject = _htmlLabel;
}
private void OnHtmlControl_click(object sender, MouseButtonEventArgs e)
{
_propertyGrid.SelectedObject = sender;
}
private void OnPropertyChanged(object sender, PropertyValueChangedEventArgs e)
{
var control = (UIElement)_propertyGrid.SelectedObject;
control.InvalidateMeasure();
control.InvalidateVisual();
}
}
}