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.
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.
Hi teamtim,
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.
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.
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 :
-My customProperty
-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 ?
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 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 ?