Editar

Compartilhar via


InkCanvas.PreferredPasteFormats Property

Definition

Gets or sets formats that can be pasted onto the InkCanvas.

public:
 property System::Collections::Generic::IEnumerable<System::Windows::Controls::InkCanvasClipboardFormat> ^ PreferredPasteFormats { System::Collections::Generic::IEnumerable<System::Windows::Controls::InkCanvasClipboardFormat> ^ get(); void set(System::Collections::Generic::IEnumerable<System::Windows::Controls::InkCanvasClipboardFormat> ^ value); };
public System.Collections.Generic.IEnumerable<System.Windows.Controls.InkCanvasClipboardFormat> PreferredPasteFormats { get; set; }
member this.PreferredPasteFormats : seq<System.Windows.Controls.InkCanvasClipboardFormat> with get, set
Public Property PreferredPasteFormats As IEnumerable(Of InkCanvasClipboardFormat)

Property Value

A collection of enumeration values. The default is InkSerializedFormat.

Examples

The following example sets the PreferredPasteFormats to make the InkCanvas accept Extensible Application Markup Language (XAML) format, Ink Serialized Format (ISF).

InkCanvasClipboardFormat[] formats = new InkCanvasClipboardFormat[]
                            { 
                              InkCanvasClipboardFormat.InkSerializedFormat,
                              InkCanvasClipboardFormat.Xaml
                            };

inkCanvas1.PreferredPasteFormats = formats;
Dim formats() As InkCanvasClipboardFormat = _
                {InkCanvasClipboardFormat.InkSerializedFormat, _
                 InkCanvasClipboardFormat.Xaml}

inkCanvas1.PreferredPasteFormats = formats

The following example accomplishes the same thing in Extensible Application Markup Language (XAML).

<InkCanvas>
  <InkCanvas.PreferredPasteFormats>
    <x:Array Type="{x:Type InkCanvasClipboardFormat}">
      <x:Static Member="InkCanvasClipboardFormat.Xaml" />
      <x:Static Member="InkCanvasClipboardFormat.InkSerializedFormat" />
    </x:Array>
  </InkCanvas.PreferredPasteFormats>
</InkCanvas>

Remarks

XAML Property Element Usage

<object>  
  <object.PreferredPasteFormats>  
    InkCanvasClipboardFormats  
  </object.PreferredPasteFormats>  
</object>  

XAML Values

InkCanvasClipboardFormats
An array of InkCanvasClipboardFormat enumeration values. Specifying an array in XAML requires x:Array usage. Specifying an enumeration value as an element that declares an array member requires x:Static usage. For more information, see x:Array Markup Extension and x:Static Markup Extension.

Applies to