We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Using a variable as an Office2010Icon.

Greetings!

I am having a task to make icons into variables into ResourceDictionary.
For normal Icon property of Window a BitmapImage with x:Key works perfect, but for Office2010Icon not.
Is it possible to set a value of this property to a DynamicResource variable?

Looking forward for your answer.

13 Replies

SP Subburaj Pandian Veluchamy Syncfusion Team May 29, 2019 02:04 PM UTC

Hi Aleksander, 
  
Thank you for contacting Syncfusion support. 
  
Currently, we are analyzing your requirement of “Using a variable as an Office2010 Icon”. We will validate and update you the further details in two business days (May 31, 2019). We appreciate your patience until then. 
 
Regards,
Subburaj Pandian V  



SP Subburaj Pandian Veluchamy Syncfusion Team May 31, 2019 01:59 PM UTC

Hi Aleksander, 
 
Thank you for your patience. 
 
Based on the provided information, we have checked the mentioned issue “Office2010Icon not using as variable”. We can use the Office2010Icon as Dynamic resource variable. We have prepared sample for the same, 
 
 
We have tested with Syncfusion version 17.1.0.38 
 
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back. It will be helpful for us to check on it and provide you the solution at the earliest. 
 
Regards,  
Subburaj Pandian V  
 



AZ Aleksander Zotov replied to Subburaj Pandian Veluchamy June 3, 2019 12:05 PM UTC




Greetings!

I click on the link you gave me and I get that it is not reachable.


JP Jagadeesan Pichaimuthu Syncfusion Team June 4, 2019 10:45 AM UTC

Hi Aleksander, 
  
We have downloaded the sample from this link and run the sample and it is working fine for us. We use the Office2010Icon as “open folder icon” on Ribbon Header. We have prepared the video for your reference and download it from following location, 
  
  
  
Can you please confirm whether you can able to download and run the sample in your end or not?. Based on your confirmation we will proceed further on this. 
  
Regards, 
Jagadeesan 



AZ Aleksander Zotov replied to Subburaj Pandian Veluchamy June 5, 2019 02:43 PM UTC

Hi Aleksander, 
 
Thank you for your patience. 
 
Based on the provided information, we have checked the mentioned issue “Office2010Icon not using as variable”. We can use the Office2010Icon as Dynamic resource variable. We have prepared sample for the same, 
 
 
We have tested with Syncfusion version 17.1.0.38 
 
Please check the sample and let us know if you still facing the same issue? If not, please modify the sample based on your scenario and revert us back. It will be helpful for us to check on it and provide you the solution at the earliest. 
 
Regards,  
Subburaj Pandian V  
 


Your solution worked, but still did not worked for mine project.

So you would understand: I am having Themes.xaml as part of Class Library. There I store all of resources.
I am having DynamicResource for Window Icon property and for your Office property with BitmapImage and UriSource="/MainProject;component/Images/ImageName".
This "/MainProject;component/" reference works for Icon but not for Office one.
I tried this approach in you example and it did not worked.


SP Subburaj Pandian Veluchamy Syncfusion Team June 6, 2019 02:20 PM UTC

Hi Aleksander, 
 
Thank you for the update. 
  
We need more information about your query “Using a variable as on Office2010 icon”. 
  
·       Have you created separate xaml file only or separate class library for resources. 
·       How you can set the Bitmap image using image source or Resource dictionary. 
  
Please provide above information or modify our sample based on your customization. It will be helpful for us to check on it and provide you the appropriate solution at the earliest.  
 
Regards,
Subburaj Pandian V 



AZ Aleksander Zotov replied to Subburaj Pandian Veluchamy June 7, 2019 09:11 AM UTC

Hi Aleksander, 
 
Thank you for the update. 
  
We need more information about your query “Using a variable as on Office2010 icon”. 
  
·       Have you created separate xaml file only or separate class library for resources. 
·       How you can set the Bitmap image using image source or Resource dictionary. 
  
Please provide above information or modify our sample based on your customization. It will be helpful for us to check on it and provide you the appropriate solution at the earliest.  
 
Regards,
Subburaj Pandian V 


I have a separate class library, connected to main project with reference. 
The working one DynamicResource is defined in class library as:

<BitmapImage x:Key="MainIcon" UriSource="/ProjectName;component/Images/Logo.ico"/>


SP Subburaj Pandian Veluchamy Syncfusion Team June 10, 2019 11:00 AM UTC

Hi Aleksander, 
  
Thank you for the update. 
  
We have analyzed your requirement of “Using Office2010Icon as a variable”. As per your suggestion, we have created a new class library for images and add this to our project. And set the Bitmap Image source as library. Binding this key as Dynamic resources for Office2010Icon, it works fine as expected.  
 
We have prepared the sample as a class library for this, it can be download from the following link, 
 
  
We hope this helps. Please let us know, if need any further assistance. 
 
Regards,
Subburaj Pandian V
 



AZ Aleksander Zotov June 13, 2019 03:22 PM UTC

BitmapImage works, but I unfortunately found out that when I have a variable in the separate class library (not only image), then after ResourceDictionary merge, variable does not work.
In separate class libraty I have Theme.xaml and image together.

I get this error:

System.Windows.Data Error: 17 : Cannot get 'Office2010Icon' value (type 'ImageSource') from '' (type 'MainWindow'). BindingExpression:Path=Office2010Icon; DataItem='MainWindow' (Name=''); target element is 'TitleBar' (Name='PART_TitleBar'); target property is 'NoTarget' (type 'Object')


SP Subburaj Pandian Veluchamy Syncfusion Team June 14, 2019 01:32 PM UTC

Hi Aleksander, 
  
Thank you for your update. 
  
Currently, we are analyzing your reported issue “Cannot get the Office2010Icon from the binding expression”. We will validate these binding errors from our end and update you the further details on June 18, 2019. We appreciate your patience until then. 
 
Regards,
Subburaj Pandian V 



JP Jagadeesan Pichaimuthu Syncfusion Team June 18, 2019 01:39 PM UTC

Hi Aleksander, 
  
Thank you for your patience. 
  
Based on the provided information, we have checked the mentioned issue “Office2010Icon property does not works“ and we unable to replicate the issue from end, it is working fine as expected. We have prepared sample for the same, 
  
  
In this sample, we have created the new image source property in separate class library. And bind this property for Office2010Icon. 
  
Please check the sample and let us know. If you still facing the same issue, please modify the sample based on your scenario
  
It will be helpful for us to check on it and provide you the solution at the earliest.   
  
Regards, 
Jagadeesan 



AZ Aleksander Zotov June 26, 2019 10:51 AM UTC

Thank you very much!
It helped.


SP Subburaj Pandian Veluchamy Syncfusion Team June 26, 2019 10:56 AM UTC

Hi Aleksander,  
   
Thank you for the update. We are glad that the given solution meets your requirement.  
   
Please get in touch with us if you would require any further assistance. 
  
Regards,
Subburaj Pandian V  


Loader.
Live Chat Icon For mobile
Up arrow icon