具有(4)文本框的多绑定转换器 [英] Multi Binding Converter With (4)Text Boxes

查看:46
本文介绍了具有(4)文本框的多绑定转换器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,
我有一个名为4的文本框
1)Txt_TotalBill->持有某物的总价
2)Txt_Discount1->持有折扣
3)Txt_Discount2->持有折扣2还
4)Txt_HaryDiscount->持有折扣3
我尝试在第一个文本框(Txt_TotalBill)中进行多重绑定
我想将其绑定到转换器以将所有这三个折扣应用于Txt_TotalPrice
中的总价格 例如:
Txt_Total = 100,Txt_Discount1 = 5,Txt_discount2 = 5,Txt_HarryDiscount = 5;
因此Txt_Total = 100-100 * 5/100 = 80,与其他三个相同的方程式以及应用该方程式后的最终值将保留在txt_Total中(因此,我希望转换器将其从三个文本框和路径中转换为三个折扣.将这些折扣应用于第四个文本框中的Value,然后在Txt_Total(第四个文本框中)中返回最终值)
有人可以帮我吗

这是Txt_Total(第四文本框)的源代码

hi every one ,
i have a 4 textBox Called
1) Txt_TotalBill --> holds the total price for some thing
2)Txt_Discount1 -- > hold discount
3)Txt_Discount2 -- > hold discount 2 also
4)Txt_HaryDiscount -- > hold discount 3
i try to make multi binding in the first text box (Txt_TotalBill)
and i want to Bind it to a converter to apply all these three discounts to the totalprice in the Txt_TotalPrice
Ex:
Txt_Total = 100 , Txt_Discount1=5 , Txt_discount2=5 , Txt_HarryDiscount=5;
So Txt_Total = 100 - 100 * 5 / 100 = 80 , the Same Equations with the Three other and the final Value After applying the equation Will Stay in txt_Total (So I want a converter to path it the three discount From the three Text Boxes and apply these discounts to the Value in the fourth text boxes an return the Final Value in Txt_Total (Fourth Text Box) )
can any one help me in doing that

this is the Source Code of the Txt_Total(Fourth Text Box)

<TextBlock Name="Txtb_FinalTotal"  MinWidth="60" Grid.Column="3" VerticalAlignment="Center" FontSize="10"

                        Margin="2,2,2,2">
                    <TextBlock.Text>
                        <MultiBinding Converter="{StaticResource CPBC}" Mode="OneWay">
                            <Binding ElementName="Txt_Discount1" Path="Text" Mode="TwoWay"/>
                            <Binding ElementName="Txt_Discount2" Path="Text" Mode="TwoWay"/>
                            <Binding ElementName="Txt_HarryDiscount" Path="Text" Mode="TwoWay"/>
                        </MultiBinding>
                    </TextBlock.Text>

                </TextBlock>




____________________




____________________

推荐答案

< add connectionstring ="con" connectionstring ="data source ="'';;数据库= pubs; uid = sa; pwd = sa; asyn = true"
<add connectionstring="con" connectionstring="data source=''.'';database=pubs;uid=sa;pwd=sa;asyn=true"


这篇关于具有(4)文本框的多绑定转换器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆