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
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.
I apologize, but I'm still having issues wrapping my head around what is actually happening in your application. What I had originally thought was that your XamTileManager's ItemsSource was bound to a list of Issues on a particular selected Car, and so the issues were what was shown in the tiles belonging to your XamTileManager. Now, you are saying that you have your XamTileManager bound to a list of Cars, but you are essentially changing the selected Car. This would mean that each of the items displayed in your XamTileManager is a XamTile representative of a Car object, but then I'm not sure where the Issues come in?
Regarding the ItemTileInfo class, it does sound like this would be a good start for you, as this does have a SizeOverride property which you can set to designate a XamTile's desired size. The persistence framework may help you to rearrange the tiles in the way that you are looking to rearrange them, but as mentioned above, I am having a difficult time wrapping my mind around what is actually happening in your application, and therefore what exactly you are looking to achieve.
Would it be possible for you to please provide an isolated sample project that demonstrates exactly what is happening with your implementation of the XamTileManager control and that demonstrates the issue that you are having? Perhaps via a sample project and a bit more information related to the functionality you are looking to achieve, I may be able to assist you better.
I explain the context of my issue :
I have a XamDataGrid and a XamTileManager in my window.
In my view Model, I have two datacontext with a list of Cars and Issues:- CarsSelection.Items used by XamDataGrid- ResultGrid.Items used by XamTileManager
A Dictionary<CarId, IDisplayContext> resultsDisplayContext to save a context link to a CarId
(IDisplayContext save content of all issues and ResultGrid.Items is a read-only list refresh by my viewModel)
The aim is to save all ItemTileInfo in the context, so I added a List<ItemTileInfo> which is re-populated when the XamDataGrid.SelectedItem changed.This list host all XamTile.ItemTileInfo to save all informations.
I can save List<ItemTileInfo>, but this info is shared between CarsSelection.Items.I don't know the correct way to have a unique List<ItemTileInfo> by CarsSelection.Item.
By this way, I can have a unique context by each CarsSelection.Item and the user can find the previous state of all ResultGrid.Items.
Which way and/or code I need to add, to build a unique context by CarsSelection.Item ?
I am assuming that a CarsSelection.Item here is an item of type Car, but I cannot be entirely sure. I still am somewhat confused, and don't completely understand the requirement, as I believe I would likely need a sample project to do so, but I think I still may be able to recommend something here.
If the CarsSelection.Item is a Car object and you are looking to have a unique context for each CarsSelection.Item, then I would recommend creating an ItemTileInfo property for your Car item. This would allow you to keep the ItemTileInfo elements on an item-by-item basis, and I imagine would allow you to keep a unique context for each Car in your collection. I cannot be entirely sure if this will work for you though, as I am still having some issues fully understanding the architecture of your application on this matter.
I hope this helps. Please let me know if you have any other questions or concerns on this matter.