Hello,
It's an example, just to describe my case :
I work at an automobile repair shop.
I have a list of cars and an unique list of issues to solve.
Each car and issue are unique, so a car can have a different issue than another one.
So I have a List<Car> Cars and Car.Issues.
For the control, if an issue is solved, the xamTile is collapsed. If an employee switch from one car to another one, issues states need to stay the same.
I try many things like PersitenceManager, PersistenceGroup and PersistenceInfo.
When I switch between cars, I save the state in the code behind, "alert" my viewModel and save it in my applicationContext.
I want to create a default context too, if a car hasn't been checked, a default view is here. At the opposite, if a car have already some fixs, I want to restore the state.
How I save this state ?
Thanks for your help
Regards
Hello teamtim,
Thank you for your post.
I am a little bit unclear on the functionality you are looking to achieve here, but from the sounds of it, you are looking to be able to have consistent state between the different Car objects that exist in a collection of Cars. Each Car element has a separate collection that contains Issues, which can be "checked," and it sounds like this Issues collection is what is bound to your XamTileManager's ItemsSource for each particular Car element. When an issue is checked, the XamTile containing that issue gets collapsed. Is this impression correct? If not, would it be possible for you to please provide some more information on the functionality you are looking for?
Currently, it sounds as if you are using the Persistence Framework to achieve this requirement, which is not really what I would recommend. Since you are likely binding to a collection of "issues" for each Car, why not do this by using an implicit Style for XamTile? When you bind the XamTileManager to a list of items, each XamTile will have a data context that is represented by that item - in this case, the "issues" for each Car object. Using a DataTrigger in an implicit Style for XamTile, you could possibly add an "IsChecked" property to your car issues and check that via the DataTriggers used in your style. If this IsChecked property returns true, then you could set the XamTile's Visibility property to Collapsed. I believe this would eliminate the need for the persistence framework in this case, as well as solve the "default context" issue you are seeing as well.
However, there is a likelihood that I am not fully understanding your requirement here, and there may be a reason that you need to use the persistence framework on this matter. If this is the case and the above procedures will not work for your requirement, then would it be possible for you to please provide some more detail on what you are looking to achieve with the XamTileManager and why the persistence framework is needed for that requirement?
Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
The XamTileManager have Cars as ItemsSource, when an issue is collapsed, I guess that a parameter in the currentXamTile is changed and saved.
I managed to create a list with ItemTileInfo with orders and sizes. This list have only one instance by XamTileManager, so if I change the currentCar, this list will have the same properties and elements.
I want to change this, to have one instance by XamTileManager.Item.
So if I change order of XamTiles, this configuration need to be save. And by changing the current Car, the saved configuration need to re-applied.
It’s like taking a screenshot and re-display it depends on which item is selected.
ItemTileInfo is a good start, but it’s will be better to have the full context like itemSize.