I have made my xamoutlookbar persistent by writing the .IsVisible() properties of my outlookbarbuttons and the .NavigationAreaMaxGroups properties to an xml file and then setting the corresponding settings on load from the xml. this is working fine however i have two other issues.
1. How could i store the order of the outlookbar buttons, if the user reorders the buttons i cant store that. I guess i need to know how to rearrange the buttons programmatically.
2. when i start my application the outlookbar buttons that i had hidden during the previous use of the program are infact hidden. the problem is that if i open the navigation pane options, and click reset it only checks the buttons that i currently am showing. I need reset to reset to show all. I guess knowing how to get to the property that the the checkbox for buttons on this screen sets would help
Hi,
Thank you for your feedback. I am glad that this solves your issue and I believe that other community members may benefit from it.
Thank you for your help, this seems to solve my issue
Hello,
I have been investigating this and modified the sample project the groups are reordered. I execute the ResetGroupSequenceAndVisibilityCommand in the btnReset_Click method which is fired when the reset button is clicked. Then I loop through all the items in the list which contains the groups’ names and set the IsSelected property to through. The items are arranged to the default order and all are checked.
Please have a look at the attached project (WpfApplication1_modified2.zip) and let me know if it helps you.
Everythign to this point i have gotten to work. the only issue i have now is that when i click the reset on the navigation pane, the checkboxes check, but i need to reorder them back to the original order. I have accessed the listbox items as follows, but i do not know how to reorder them.
CheckBox check = Utilities.GetDescendantFromType(item as DependencyObject, typeof(CheckBox), false) as CheckBox; var headerName= Utilities.GetDescendantFromType(item as DependencyObject, typeof(ContentPresenter), false) as ContentPresenter; var header =Utilities.GetDescendantFromType(headerName as DependencyObject, typeof (ContentPresenter), false) as ContentPresenter;
Hello Pete,
I have been looking into this further. The Persistencemanager does not save all the properties by default. What I could suggest you here is to use the PersistenceSettings property in order to define the properties you want to be saved by the control. E.g. If you want to save the pictures of the outlookbar groups and the groups order you can use the following code:
<ig:PersistenceManager.Settings>
<ig:PersistenceSettings >
<ig:PersistenceSettings.PropertySettings>
<ig:PropertyNamePersistenceInfo PropertyName="LargeImage" Options="PropertyPath"/>
<ig:PropertyNamePersistenceInfo PropertyName="Items" Options="PropertyPath"/>
</ig:PersistenceSettings.PropertySettings>
</ig:PersistenceSettings>
</ig:PersistenceManager.Settings>
Another approach for applying the image would be to add it after the persistencemanager has load the outlookbar:
PersistenceManager.Load(this.outlookBar, stream);
foreach (var group in outlookBar.Groups)
{
group.LargeImage = new BitmapImage(new Uri("pack://application:,,,/outllook.jpg"));
}
Please do not hesitate to ask if you have any other questions.