This is a migrated thread and some comments may be shown as answers.

OutlookBarItem Icon in ResourceDictionary

3 Answers 56 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
Renier Pretorius asked on 28 Oct 2013, 05:44 AM
I am building a solution with multiple front-end clients and wish to maintain a consistent Look&Feel between them. For this I have created a shared Silverlight library which contains common resources including all images/icons. I have declared a resource dictionary in this project which I then merge into the other client projects in the root visual. I have used this successfully to add image to a RadButton as follows:
<ResourceDictionary
     
    <ImageSource x:Key="HomeIcon">Images/house_16xLG.png</ImageSource>
     
</ResourceDictionary>

<telerik:RadButton.Content>
    <StackPanel Orientation="Horizontal">
        <Image Source="{StaticResource HomeIcon}" Margin="3" Stretch="None" VerticalAlignment="Center" />
        <TextBlock Text="Home" VerticalAlignment="Center" Margin="3"/>
    </StackPanel>
</telerik:RadButton.Content>

Now I also want to use these images as icons for RadOutlookBarItem but I am struggling to find the right syntax (assuming that it is possible)

3 Answers, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 30 Oct 2013, 03:05 PM
Hi Renier,

I am not sure that I understand where you need to add that image. Could you please take a look at the visual structure of the RadOutlookBar control and let us know the exact place where you need to import your image.

Thank you for your cooperation.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
answered on 30 Oct 2013, 04:08 PM
Hi Pavel,

Sorry if my post was not clear. I have found a workaround but it is not quite as elegant as the image dictionary method I wanted to use.

What I am using is:
<telerik:RadOutlookBarItem Header="General"
    Icon="/KIO.Logistics.Apps.Common;component/Resources/Images/screwdriver_24xLG.png"
    SmallIcon="/KIO.Logistics.Apps.Common;component/Resources/Images/screwdriver_16xLG.png">
</telerik:RadOutlookBarItem>

What I wanted to do was:
<telerik:RadOutlookBarItem Header="General"
    Icon="{StaticResource ScrewDriverIconLarge}"
    SmallIcon="{StaticResource ScrewDriverIconSmall}">
</telerik:RadOutlookBarItem>

My issue is what to put here:
<ResourceDictionary
 
    <ImageSource x:Key="HomeIcon">Images/house_16xLG.png</ImageSource>
 
     <telerik:RadOutlookBarItem.Icon x:Key="ScrewDriverIconLarge">Images/screwdriver_16xLG.png</telerik:RadOutlookBarItem.Icon> <== THIS LINE
 
</ResourceDictionary>

Thanks for your assistance

Regards

Renier
0
Pavel R. Pavlov
Telerik team
answered on 04 Nov 2013, 09:43 AM
Hi Renier,

The approach that you came up with is a possible solution in your case.

However, you can try merging your custom dictionary as application resource. You can find more information on that matter here. When following this approach you need to have in mind that the Silverlight plug-in has limited access to the file system. You can find more information here.

Once the dictionary is merged you should be able to access the images by x:Key attribute.

I hope this information is helpful.

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
OutlookBar
Asked by
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Pavel R. Pavlov
Telerik team
Renier Pretorius
Top achievements
Rank 2
Iron
Iron
Iron
Share this question
or