locked
I have a lot of Bindings which are relevant for source to target updates only RRS feed

  • Question

  • Should I be explicity setting BindingMode=OneWay on them? (by default, bindings are set as TwoWay)

    I suppose the main reason to do so is to avoid unintended target to source updates. But my bindings are mainly Visibility or IsEnabled bindings which will never have a source to target update.

    Is there any other reason (e.g. performace) why it would be good practice to explicity set BindingMode=OneWay?

    Wednesday, March 16, 2011 2:48 PM

Answers

  • Hi rizzlwizzl,

    I think you could refer to this article:

    http://msdn.microsoft.com/en-us/library/system.windows.data.bindingmode.aspx

    -->   Is there any other reason (e.g. performace) why it would be good practice to explicity set BindingMode=OneWay?

    Do you mean when should we use the BindingMode = OneWay?

    for example, if you have two textbox to display the same data, just one textbox could change the data source dynamically, you could set the BindingMode = OneWay to this textbox, the other one as TwoWay, then for the OneWay textbox, the data source will change the text porperty of this textbox, it could not in turn.

     

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Sheldon _Xiao Thursday, March 24, 2011 9:58 AM
    Friday, March 18, 2011 3:55 AM

All replies

  • Hi rizzlwizzl,

    I think you could refer to this article:

    http://msdn.microsoft.com/en-us/library/system.windows.data.bindingmode.aspx

    -->   Is there any other reason (e.g. performace) why it would be good practice to explicity set BindingMode=OneWay?

    Do you mean when should we use the BindingMode = OneWay?

    for example, if you have two textbox to display the same data, just one textbox could change the data source dynamically, you could set the BindingMode = OneWay to this textbox, the other one as TwoWay, then for the OneWay textbox, the data source will change the text porperty of this textbox, it could not in turn.

     

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Sheldon _Xiao Thursday, March 24, 2011 9:58 AM
    Friday, March 18, 2011 3:55 AM
  • Hi rizzlwizzl,

    I am marking your issue as "Answered", if you have new findings about your issue, please let me know.

     

    Best regards,


    Sheldon _Xiao[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, March 24, 2011 9:58 AM