Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
In the following example, when the user clicks on the Figure, the Width of the Figure decreases. Below is the XAML for the sample.
Raw text inside the paragraph
Text inside of paragraph that is inside Figure...
Below is the code used to decrease the Width of the Figure.
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace SDKSample
{
public partial class FigureLengthExample : Page
{
void OnMouseDownDecreaseWidth(object sender, MouseButtonEventArgs args)
{
FigureLength myFigureLength = myFigure.Width;
double widthValue = myFigureLength.Value;
if (widthValue > 0)
{
myFigure.Width = new FigureLength((widthValue - 10), FigureUnitType.Pixel);
}
}
}
}
Remarks
XAML Attribute Usage
-or-
XAML Values
length
The width or height of the Figure in pixels, described as a Double value. Alternatively, this value can be qualified with a unit declaration string (px, in, cm, pt) see qualifiedDouble below.
qualifiedDouble
A double value as described above followed by one of the following unit declaration strings: px, in, cm, pt.
px (default) is device-independent units (1/96th inch per unit)
Compares two FigureLength structures for inequality.
Applies to
Collaborate with us on GitHub
The source for this content can be found on GitHub, where you can also create and review issues and pull requests. For more information, see our contributor guide.