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
I have attached a project demonstrating my issues
Any Ideas?
Hello Pete,
I have been looking into your post and modified the sample you are using in order to achieve the functionality you need. You can store the order and all the settings of the outlookbar by using the PersistenceManager. I added two buttons below the outlookbar for saving and loading these settings using the approach.
Then I used the default style of the NavigationPaneOptionsControl which is located in C:\Program Files (x86)\Infragistics\NetAdvantage <version here>\WPF\DefaultStyles\OutlookBar\OutlookBarBase.xaml. I removed the defined command of the btnReset and handled its click event and the loaded event of the PART_ListBox. These events are used to get the checkbox items when the btnReset is clicked and set their IsChecked property to true.
Please feel free to let me know if you have any questions regarding this.
this does work, unfortunately it is clearing the formattingof my outlookbar. The icons associated with the groups no longer exist when i reload
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.
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,
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.
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