1: public string HtmlElementId
2: {
3: get { return (string)GetValue(HtmlElementIdProperty); }
4: set { SetValue(HtmlElementIdProperty, value); }
5: }
6:
7: public string HtmlElementPropertyName
8: {
9: get { return (string)GetValue(HtmlElementPropertyNameProperty); }
10: set { SetValue(HtmlElementPropertyNameProperty, value); }
11: }
12:
13: public string HtmlElementValue
14: {
15: get { return (string)GetValue(HtmlElementValueProperty); }
16: set { SetValue(HtmlElementValueProperty, value); }
17: }
18:
19: public static readonly DependencyProperty HtmlElementIdProperty =
20: DependencyProperty.Register("HtmlElementId", typeof(string), typeof(HtmlBinder), null);
21:
22: public static readonly DependencyProperty HtmlElementPropertyNameProperty =
23: DependencyProperty.Register("HtmlElementPropertyName", typeof(string), typeof(HtmlBinder), null);
24:
25: public static readonly DependencyProperty HtmlElementValueProperty =
26: DependencyProperty.Register("HtmlElementValue",
27: typeof(string),
28: typeof(HtmlBinder),
29: new PropertyMetadata(new PropertyChangedCallback((s, e) =>
30: {
31: HtmlBinder htmlBinder = (HtmlBinder)s;
32: HtmlPage.Window.Eval(String.Format("document.getElementById('{0}')['{1}'] = {2}",
33: htmlBinder.HtmlElementId,
34: htmlBinder.HtmlElementPropertyName,
35: htmlBinder.HtmlElementValue));
36: })));
37: }