Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
785
Display tooltips for disabled outlookbargroups
posted

Hi,

   I'm using an OutlookBar to have the same behaviour as in Outlook (select on the left, show result on the right).

   Based on some security settings I can easily disable the groups the user has no access to. The OutlookBar behaves as I expected and the user can see that there are some features that he/she cannot access.

 

   However, now I've got a new requirement: to inform the user that the disabled groups are inaccessible by design and display a ToolTip or something saying that they can get the full version etc...

 

   In Silverlight I get around the fact that I can't display tooltips for a disabled control by wrapping the control inside a border and setting the tooltip on the border. Unfortunately I couldn't see an easy way to it for the OutlookBar as I can see in the style that the OulookBarGroups are inserted inside an ItemsControl.

   Is there a style somewhere that I can override to wrap the OutlookBarGroup into a Border or can somone suggest a better way of solving this issue?

 

Cheer.

 

Parents
  • 3071
    Verified Answer
    posted

    Hi,
    To display an inaccessible group you can use HeaderTemplate and SmallIconTemplate properties.
    You can prevent the user to select an inaccessible group using the SelectedGroupChanging event.
    Here is a sample:

    <igBar:XamWebOutlookBar x:Name="outlookBar"
                                           
    SelectedGroupChanging="outlookBar_SelectedGroupChanging">
        <igBar:OutlookBarGroup Header="EnabledGroup 1"/>
        <igBar:OutlookBarGroup Header="DisabledGroup" 
                                            ToolTip
    ="this group is inaccessible by design">
            <igBar:OutlookBarGroup.HeaderTemplate>
                <DataTemplate>
                    <ContentControl Content="{Binding}" Foreground="Gray" FontWeight="Normal"
                                            ToolTipService.ToolTip="this group is inaccessible by design"/>
                </DataTemplate>
            </igBar:OutlookBarGroup.HeaderTemplate>
            <igBar:OutlookBarGroup.SmallIconTemplate>
                <DataTemplate>
                    <TextBlock Text="x" FontWeight="Normal" Foreground="Gray" 
                                        HorizontalAlignment="Center" VerticalAlignment="Center"/>
                </DataTemplate>
            </igBar:OutlookBarGroup.SmallIconTemplate>
        </igBar:OutlookBarGroup>
        <igBar:OutlookBarGroup Header="EnabledGroup 2"/>
    </igBar:XamWebOutlookBar>

    private void outlookBar_SelectedGroupChanging(object sender, SelectedGroupChangingEventArgs e)
    {
        if (e.NewSelectedOutlookBarGroup != null )
        {
            e.Cancel = e.NewSelectedOutlookBarGroup.HeaderTemplate != null;

        }
    }

    Regards,
    Marin

     

Reply Children
No Data