dotNET
dotNET

Reputation: 35470

Alternate syntax in XAML for applying attached property

How do I re-write the following XAML:

<Button Command="{Binding NewSalesOrderCommand}" Content="New Order" Width="50" />

So that I could use an attached property on the Command object:

<Button Content="New Order" Width="50">
    <Button.Command local:MyClass.MyAttachedProp="1">
        ...
    </Button.Command>
</Button>

means what appears in place of 3 dots?

Upvotes: 2

Views: 269

Answers (1)

DHN
DHN

Reputation: 4865

Hmm, try the following

<Button Content="New Order" Width="50">
    <Button.Command local:MyClass.MyAttachedProp="1">
        <Binding Path="NewSalesOrderCommand" />
    </Button.Command>
</Button>

For more information, pls have a look here.

Upvotes: 1

Related Questions