Page 1 of 1

App Bar Integration vs. Replacement

Posted: Mon Oct 15, 2012 1:13 pm
by adamaka
So in my previous post here (http://forum.stimulsoft.com/viewtopic.php?f=10&t=34998) I was able to get the IntegrateToTheBottomAppBar & IntegrateToTheTopAppBar working. However, it's not so much as an Integration to as a replacement for the Application Bar, right? What I mean is, I have some buttons in my app bar in xaml, but when I run the app and show the viewer page, the buttons are replaced by the viewer buttons. Is there a way to add buttons to the application bar in the report viewer? Failing that, is there a way to move the default buttons around? Say, have all the active commands on the TopAppBar so I can fill the bottom with whatever I want?
If all else fails, do you have a style I can point to with my application bar that adopts the grey/orange Stimulsoft app bar style?

Thanks again

Re: App Bar Integration vs. Replacement

Posted: Tue Oct 16, 2012 8:13 am
by HighAley
Hello.

There are two panels could be in the application on top and bottom. The IntegrateToTheBottomAppBar and IntegrateToTheTopAppBar properties enables them.
If you need to set style you could use next code:

Code: Select all

AppBar appBar;
appBar.Background = StiStoreColors.AppBarBackground;
appBar.BorderBrush = StiStoreColors.HeaderBrush;
How to aded button on the AppBArt you could see in our 'Navigator.RT' sample project.
Look at the BlankPage.xaml.cs file, An 'Reports Demo' button is adding there.

Thank you.

Re: App Bar Integration vs. Replacement

Posted: Tue Oct 16, 2012 7:11 pm
by adamaka
Thanks! I missed that little button in the Navigator.RT sample. The theme thing works too. Also, you can modify the default Stimulsoft AppBar and AppBarButton themes by simply modifying the Page.TopAppBar and Page.BottomAppBar properties on the Page_Loaded event like so:

Code: Select all

private void BlankPage_Loaded(object sender, RoutedEventArgs e)
        {            
            foreach (var item in viewerControl.ToolbarPanel.Children)
            {
                if (item.GetType() == typeof(StiButton))
                {
                    ((StiButton)item).Style = (Style)App.Current.Resources["AppBarButtonStyle"];
                }
                else if (item.GetType() == typeof(Border))
                {
                    ((Border)item).Background = (Brush)App.Current.Resources["AppBarItemForegroundThemeBrush"];
                }
            }

            this.TopAppBar.Style = (Style)App.Current.Resources["GlobalAppBarStyle"];
            this.TopAppBar.Background = (Brush)App.Current.Resources["ApplicationPageBackgroundThemeBrush"];
            this.TopAppBar.BorderBrush = null;
        }
Thanks for the tip!

Re: App Bar Integration vs. Replacement

Posted: Wed Oct 17, 2012 12:29 pm
by HighAley
Hello.

We are always glad to help you.
Let us know if you need any additional help.

Thank you.