-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathXamlReaderControl.cs
More file actions
37 lines (34 loc) · 1.14 KB
/
Copy pathXamlReaderControl.cs
File metadata and controls
37 lines (34 loc) · 1.14 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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Markup;
namespace HttpCacheTestDemo
{
public sealed class XamlReaderControl : Control
{
Grid grid = null;
private const string _contentTemplate
= @"<ControlTemplate " +
"xmlns='http://schemas.microsoft.com/winfx/2006/xaml/presentation' " +
"xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'>" +
"<Grid x:Name='LayoutRoot' Background='{TemplateBinding Background}'>" +
"<Grid.RenderTransform>" +
"<MatrixTransform x:Name='MatrixTransform'/>" +
"</Grid.RenderTransform>" +
"</Grid>" +
"</ControlTemplate>";
public XamlReaderControl()
{
Template = (ControlTemplate)XamlReader.Load(_contentTemplate);
ApplyTemplate();
}
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
this.grid = (Grid)GetTemplateChild("LayoutRoot");
}
}
}