how to stop binding temporary ?
-
I'm using CSLA Framework in my business logic layer I want to use undo feature for this reason I have to Unbind the DataControl [i.e ComboBox] and rebind it to the collection source okay you may say that's very easy
ComboBox1.ItemsSource = null;
and after making my undo operation
ComboBox1.ItemsSource = DataCollection ;
I will say : you'r right but when setting the itemsSource to Null , the items in Combo will disappear the problem wil become bigger if I use DataGrid so How can I Unbind Control with out emptying its items ???:confused: :rolleyes: --- I know my be my question is ... ---
You have To Search About The Truth Of Your Life Why Are you Here In Life ?
-
I'm using CSLA Framework in my business logic layer I want to use undo feature for this reason I have to Unbind the DataControl [i.e ComboBox] and rebind it to the collection source okay you may say that's very easy
ComboBox1.ItemsSource = null;
and after making my undo operation
ComboBox1.ItemsSource = DataCollection ;
I will say : you'r right but when setting the itemsSource to Null , the items in Combo will disappear the problem wil become bigger if I use DataGrid so How can I Unbind Control with out emptying its items ???:confused: :rolleyes: --- I know my be my question is ... ---
You have To Search About The Truth Of Your Life Why Are you Here In Life ?
Why do you need to unbind and re-bind to provide the undo feature? You can use the Observable collection in which any changes you do/ undo will automatically reflect in the UI controls it is bound to. (Your type object will have to implement INotifyPropertyChanged event for this.) If you still want to bind-unbind the ItemSource without having your combobox loose its items. You will probably have to work with 2 collections mirroring each other. (i do not recommend this :>)
Pankaj Chamria, Software Developer.
-
Why do you need to unbind and re-bind to provide the undo feature? You can use the Observable collection in which any changes you do/ undo will automatically reflect in the UI controls it is bound to. (Your type object will have to implement INotifyPropertyChanged event for this.) If you still want to bind-unbind the ItemSource without having your combobox loose its items. You will probably have to work with 2 collections mirroring each other. (i do not recommend this :>)
Pankaj Chamria, Software Developer.
thanks a lot for your answer I need to stop binding when I call BeginEdit method this method in Csla so I read in CSLA Book " [[if you want to use the undo feature manually you have to call BeginEdit before you bind the object to UI and you have to Rebind the object after canceling or applying changes made to the object]] " that's why I asked about pausing or stopping binding to UI Maybe I misunderstood the CSLA Undo Feature. any way after applying changes I rebinded the object to UI and work fine so thanks
You have To Search About The Truth Of Your Life Why Are you Here In Life ?