开发者

WPF: Binding and Commands

开发者 https://www.devze.com 2023-01-02 03:32 出处:网络
My Customer has a property called SaveCommand. My form is data-bound to an instance of the Customer object.

My Customer has a property called SaveCommand.

My form is data-bound to an instance of the Customer object.

Using XAML, how would I bind Customer.SaveCommand to the form's save 开发者_如何转开发button?


Assuming the form's DataContext has been set to the customer object

<Button Content="Save Button" Command="{Binding SaveCommand}" />

or perhaps

<Button Content="Save Button" Command="{Binding SelectedCustomer.SaveCommand}" />
0

精彩评论

暂无评论...
验证码 换一张
取 消