다음을 통해 공유


Path.Data 속성

정의

그릴 셰이프를 Geometry 지정하는 값을 가져오거나 설정합니다.

public:
 property System::Windows::Media::Geometry ^ Data { System::Windows::Media::Geometry ^ get(); void set(System::Windows::Media::Geometry ^ value); };
public System.Windows.Media.Geometry Data { get; set; }
member this.Data : System.Windows.Media.Geometry with get, set
Public Property Data As Geometry

속성 값

그릴 셰이프에 대한 설명입니다.

예제

다음 예제에서는 코드를 사용하여 요소를 만들고 Path 속성을 설정하는 Data 방법을 보여 있습니다.


//Add the Path Element
myPath = gcnew Path();
myPath->Stroke = Brushes::Black;
myPath->Fill = Brushes::MediumSlateBlue;
myPath->StrokeThickness = 4;
myPath->HorizontalAlignment = HorizontalAlignment::Left;
myPath->VerticalAlignment = VerticalAlignment::Center;
EllipseGeometry^ myEllipseGeometry = gcnew EllipseGeometry();
myEllipseGeometry->Center = Point(50, 50);
myEllipseGeometry->RadiusX = 25;
myEllipseGeometry->RadiusY = 25;
myPath->Data = myEllipseGeometry;
myGrid->Children->Add(myPath);

//Add the Path Element
myPath = new Path();
myPath.Stroke = System.Windows.Media.Brushes.Black;
myPath.Fill = System.Windows.Media.Brushes.MediumSlateBlue;
myPath.StrokeThickness = 4;
myPath.HorizontalAlignment = HorizontalAlignment.Left;
myPath.VerticalAlignment = VerticalAlignment.Center;
EllipseGeometry myEllipseGeometry = new EllipseGeometry();
myEllipseGeometry.Center = new System.Windows.Point(50,50);
myEllipseGeometry.RadiusX = 25;
myEllipseGeometry.RadiusY = 25;
myPath.Data = myEllipseGeometry;
myGrid.Children.Add(myPath);

' Add a Path Element
Dim myPath As New Path()
myPath.Stroke = Brushes.Black
myPath.Fill = Brushes.MediumSlateBlue
myPath.StrokeThickness = 4
myPath.HorizontalAlignment = HorizontalAlignment.Left
myPath.VerticalAlignment = VerticalAlignment.Center
Dim myEllipseGeometry As New EllipseGeometry()
myEllipseGeometry.Center = New System.Windows.Point(50, 50)
myEllipseGeometry.RadiusX = 25
myEllipseGeometry.RadiusY = 25
myPath.Data = myEllipseGeometry
myGrid.Children.Add(myPath)

설명

간단한 셰이프를 그리려면 , LineGeometryRectangleGeometry 개체를 EllipseGeometry사용합니다. 곡선, 호 또는 복합 셰이프를 그리려면 개체를 PathGeometry 사용합니다. 복합 기하 도형을 만들려면 .를 GeometryGroup사용합니다. 기하 도형을 결합하려면 .를 CombinedGeometry사용합니다.

XAML 속성 요소 사용

<Path>
  <Path.Data>
    singleGeometry
  </Path.Data>
</Path>

XAML 특성 사용

<object Data="moveAndDrawCommands"/>

XAML 값

singleGeometry 에서 Geometry파생되는 단일 개체 요소입니다. 다음 중 하나가 될 수 있습니다.

moveAndDrawCommands 하나 이상의 이동 및 그리기 명령. 전체 구문은 경로 태그 구문을 참조하세요.

종속성 속성 정보

Item 가치
식별자 필드 DataProperty
메타데이터 속성이 다음으로 설정됩니다. true AffectsRender, AffectsMeasure

적용 대상