|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
namespace Grid960Sample
{
public partial class ElementView : UserControl
{
public ElementView()
{
InitializeComponent();
}
private void border_SizeChanged(object sender, SizeChangedEventArgs e)
{
MeasuredWidth = border.ActualWidth;
}
/// <summary>
/// The DependencyProperty for the MeasuredWidth property.
/// </summary>
private static readonly DependencyProperty MeasuredWidthProperty =
DependencyProperty.Register("MeasuredWidth", typeof(double), typeof(ElementView),
new PropertyMetadata(0.0, new PropertyChangedCallback(OnMeasuredWidthChanged)));
/// <summary>
/// Gets or sets MeasuredWidth.
/// </summary>
/// <value>The value of MeasuredWidth.</value>
public double MeasuredWidth
{
get { return (double)GetValue(MeasuredWidthProperty); }
set { SetValue(MeasuredWidthProperty, value); }
}
/// <summary>
/// Called when MeasuredWidth is changed.
/// </summary>
/// <param name="o">The o.</param>
/// <param name="args">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
private static void OnMeasuredWidthChanged(DependencyObject o, DependencyPropertyChangedEventArgs args)
{
ElementView me = o as ElementView;
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.