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 want to save a context for each CarsSelection. The current context about issues values is stored in the IDisplayContext.
I manage to save all itemTileInfo with List for each CarsSelection.Item, but for the restore step, I don't know how to do.
My software is saving informations at animation.Ending, but I don't how to prevent the saving if the user change his current view so a restore is "needed".
Could you help me ?
The ItemTileInfo lists contain information about each of the tiles, and since you are saving a list of these for each of your items, it will include a list of a item information about the tiles that exist for each item. I am assuming that you are currently wondering how to get the ItemTileInfo information into the tiles that represent your item, so please correct me if I am wrong. After you load your layout and the XamTileManager's layout loads, you can look at your data and get each tile that exists for the newly selected data items by using the XamTileManager.TileFromItem method. Using this method, you can pass your data items that you have selected for display in the XamTileManager, receive the XamTile that represents those data items, and then you can look at your list of ItemTileInfo elements to apply those settings to the tiles that exist for those elements.
Regarding the animation-related event in the XamTileManager, I would expect that your selection in your XamDataGrid would happen prior to this animation event being fired for the XamTileManager. If this is the case, I would recommend that addition of a globally accessible bool flag that you can check in your AnimationEnded event handler, which can be set in the XamDataGrid.SelectedItemsChanged event, as that will fire when you select a new row in your XamDataGrid. As an alternative, I imagine you could also set this flag prior to the code that you are using to change the display of the XamTileManager, as I imagine that you are likely programmatically changing it.
If this flag is set to a certain value, you could check that value in the AnimationEnded event, and prevent the save if necessary.
I'm back with an issue :
My software have one view with a DataGrid and a XamTileManager.
They both depends from a viewModel and a context to save DataGrid and XamTileManager details.
To be able to have a context by DataGrid item, I created an attachedProperty to my XamTileManager. It's allow me to save and restore settings with the PersitenceFramework.
I attached some files :
-An extract of my architecture
Backup is fully functional, but when I load the configuration (line 123), it's impossible to maximize more than one item.
if there is a second item, he is hide at the background of the first. if I minimize the first maximized, all tiles are well displayed.
I try to set the maximizedTieLimit and sizes, without improvements. The line to be changed is maybe at the line 155.
Could you help me to have both tiles mazimized ?
It was a month ago, and now this feature is blocking the release of a software.
I don't manage to restore the context of tiles, it's really important for my company to be a ble to save and restore the state of all tiles.
This is a new issue so it would have been better to open a new thread instead. Since you have created a support case (CAS-174342-N6M4M0) to bring this issue to our attention we should continue this issue inside that support case from now on.