PathFigure 類別

定義

代表幾何子區段,即二維幾何區段的一系列單一連線。

public ref class PathFigure sealed : DependencyObject
/// [Microsoft.UI.Xaml.Markup.ContentProperty(Name="Segments")]
/// [Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PathFigure final : DependencyObject
[Microsoft.UI.Xaml.Markup.ContentProperty(Name="Segments")]
[Windows.Foundation.Metadata.Activatable(65536, "Microsoft.UI.Xaml.WinUIContract")]
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public sealed class PathFigure : DependencyObject
Public NotInheritable Class PathFigure
Inherits DependencyObject
<PathFigure .../>
-or-
<PathFigure ...>
  oneOrMorePathSegments
</PathFigure
繼承
Object Platform::Object IInspectable DependencyObject PathFigure
屬性

範例

此範例會建立由具有LineSegment的單一PathFigure所組成的簡單PathGeometry,並使用Path元素來顯示它。 PathFigure 物件的 StartPoint 設定為 (10,20) ,而 LineSegment 會以 (100,130) 的端點定義。

<Canvas>
    <Path Stroke="Black" StrokeThickness="4">
        <Path.Data>
            <PathGeometry>
                <PathGeometry.Figures>
                    <PathFigure StartPoint="10,20">
                        <PathFigure.Segments>
                            <LineSegment Point="100,130"/>
                        </PathFigure.Segments>
                    </PathFigure>
                </PathGeometry.Figures>
            </PathGeometry>
        </Path.Data>
    </Path>
</Canvas>
<Canvas>
    <Path Stroke="Black" StrokeThickness="4" >
        <Path.Data>
            <PathGeometry>
                <PathGeometry.Figures>
                    <PathFigure StartPoint="10,50">
                        <PathFigure.Segments>
                            <BezierSegment Point1="100,0"
                                           Point2="200,200"
                                           Point3="300,100"/>
                            <LineSegment Point="400,100" />
                            <ArcSegment Size="50,50" 
                                        RotationAngle="45"
                                        IsLargeArc="True" 
                                        SweepDirection="Clockwise"
                                        Point="200,100"/>
                        </PathFigure.Segments>
                    </PathFigure>
                </PathGeometry.Figures>
            </PathGeometry>
        </Path.Data>
    </Path>
</Canvas>

備註

PathFigureCollection 是 PathFigure 專案的強型別集合。 PathFigureCollectionPathGeometry.Figures 屬性所使用的類型。 在 XAML 中,指定此屬性的一或多個 PathFigure 元素。

這個類別與設定 PathPathIcon的向量數據有關。

您也可以定義區段和單一 PathFigure 做為字串內向量的一部分,而不是建立實例或物件元素,以用於 Move 和 draw 命令語法

建構函式

PathFigure()

初始化 PathFigure 類別的新實例。

屬性

Dispatcher

一律會在 Windows 應用程式 SDK 應用程式中傳null回 。 請改用 DispatcherQueue

(繼承來源 DependencyObject)
DispatcherQueue

DispatcherQueue取得與這個 物件相關聯的 。 DispatcherQueue表示即使程式代碼是由非UI線程起始,也可以存取 DependencyObject UI線程上的設備。

(繼承來源 DependencyObject)
IsClosed

取得或設定值,這個值表示此圖的第一個和最後一個區段是否連接。

IsClosedProperty

識別 IsClosed 相依性屬性。

IsFilled

取得或設定值,這個值表示這個 PathFigure 的包含區域是否要用於點擊測試、轉譯和裁剪。

IsFilledProperty

識別 IsFilled 相依性屬性。

Segments

取得或設定區段集合,這些區段定義這個 PathFigure 對象的圖形。

SegmentsProperty

識別 Segment 相依性屬性。

StartPoint

取得或設定 PathFigure 開始的 Point

StartPointProperty

識別 StartPoint 相依性屬性。

方法

ClearValue(DependencyProperty)

清除相依性屬性的本機值。

(繼承來源 DependencyObject)
GetAnimationBaseValue(DependencyProperty)

傳回為相依性屬性建立的任何基底值,如果動畫未使用中,則適用此屬性。

(繼承來源 DependencyObject)
GetValue(DependencyProperty)

DependencyObject 傳回相依性屬性的目前有效值。

(繼承來源 DependencyObject)
ReadLocalValue(DependencyProperty)

如果已設定本機值,則傳回相依性屬性的本機值。

(繼承來源 DependencyObject)
RegisterPropertyChangedCallback(DependencyProperty, DependencyPropertyChangedCallback)

註冊通知函式,以接聽此 DependencyObject 實例上特定 DependencyProperty 的變更。

(繼承來源 DependencyObject)
SetValue(DependencyProperty, Object)

設定 DependencyObject 上相依性屬性的本機值。

(繼承來源 DependencyObject)
UnregisterPropertyChangedCallback(DependencyProperty, Int64)

取消先前透過呼叫 RegisterPropertyChangedCallback 註冊的變更通知。

(繼承來源 DependencyObject)

適用於

另請參閱