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
875
How to set small or LargeImage path in Code Behind
posted

using the outllokbar in xaml, this is no problem.  Here is my example:

<igOB:OutlookBarGroup x:Name="FredTab"

LargeImage

 

="Images\addbk_24x24.png">

</

 

igOB:OutlookBarGroup>

How can i do this in code behind without the full path?  This is what I have now:

ARC210Group.SmallImage =

new BitmapImage(new Uri(@"C:\Projects\CMDL NET\CMDL.MissionLoaderTool.Framework\Images\prefs_16x16.png", UriKind.RelativeOrAbsolute));

This works, but obviously I don't want the C:\Projects... path, I want a relative path.

 

 

 

Parents
No Data
Reply
  • 54937
    Offline posted

    This isn't specific to our elements but if you want to specify a Uri that is based upon a relative path then you would probably use the BaseUriHelper class to get the base uri for the usercontrol/window. So the construction of the Uri would look something like new Uri(BaseUriHelper.GetBaseUri(this), @"Images\addbk_24x24.png").

Children
No Data