Home > Net >  The binding problem in WPF
The binding problem in WPF

Time:09-18

How to bind the sum of product of receivables against the number of tickets and ticket price? , of which the fare has been involved in objectdataprovider binding

Homework needs have been met, but I still want to fully use the binding mechanism completely homework

CodePudding user response:

Help children , the school is winform I self-study WPF

CodePudding user response:

The accounts receivable=price * number;
At this time of the xaml binding part of the accounts receivable and accounts receivable corresponding field such as the field name is Receivables
We can change the definition of Receivables attribute
Public double Receivables {get=& gt; Receivables; The set=& gt; Receivables=value; }
Instead of
Public double Receivables {get=& gt; Ticket number *; The set=& gt; Receivables=value; }

CodePudding user response:

refer to the second floor OrdinaryCoder response:
c=price * number;
At this time of the xaml binding part of the accounts receivable and accounts receivable corresponding field such as the field name is Receivables
We can change the definition of Receivables attribute
Public double Receivables {get=& gt; Receivables; The set=& gt; Receivables=value; }
Instead of
Public double Receivables {get=& gt; Ticket number *; The set=& gt; Receivables=value; }

Thank you, I try

CodePudding user response:

First, the method can be on the second floor, but you need to pay attention to, when you modify the other two attributes, don't forget to tell the attributes of the page to update the receivables,
Second, you can also use more binding, MultiBinding, but need to use the Convert, custom Convert.

CodePudding user response:

Well well, thank you, I try to see

CodePudding user response:

Weilebuluoaxiba
reference 4 floor response:
first, on the second floor of the methods can be, but need to pay attention to, when you modify the other two attributes, don't forget to tell the attributes of the page to update the receivables,
Second, you can also use more binding, MultiBinding, but need to use the Convert, custom Convert,

Try the eldest brother, I solved the
  • Related