0

Can I do two way binding with an XML document in metro style apps (using WPF/C#)? I want my XML file to get updated as soon as I make a change on the UI

Haider
  • 461
  • 4
  • 20

3 Answers3

0

Sure. After update invoke your method that will update your xml file. It won`t work automaticly, you need to manage this yourself

Fixus
  • 4,631
  • 10
  • 38
  • 67
  • Right, but I want to do it automatically. This was possible in WPF apps I guess...I was wondering if this is achievable in metro style apps or not? Actually, I want to have auto-save feature in my app – Haider Oct 05 '12 at 12:03
0

You are asking about XAML's Mode=TwoWay binding (default is Mode=OneWay), but I think you really mean UpdateSourceTrigger=PropertyChanged (as in WPF) which in WinRT is a bit of a trick. Answer is here: “UpdateSourceTrigger=PropertyChanged” equivalent for a TextBox in WinRT-XAML

Community
  • 1
  • 1
Jerry Nixon
  • 31,313
  • 14
  • 117
  • 233
0

may be u can call the saveXML() method on 'textChanged' event of the textboxes or any other UI controls of your metro app...

dove
  • 20,469
  • 14
  • 82
  • 108
Vivek Khatri
  • 51
  • 1
  • 1
  • 7