locked
How to prorammaticaly change the application logo? RRS feed

  • Question

  • Hi,

    My application is targetting multi-organization.  I set up a table and screen where a certain organization could customized some details about their agency like Agency Name and agency Logo.  

    My question is:  How to change the application logo programmatically?

    KharolJ

    Friday, February 8, 2013 1:51 AM

Answers

  • You won't be able to change the logo at runtime very easily. There is no API that will allow you to change it. It's possible that you could use the VisualTreeHelper to crawl down the visual tree until you find it and then change the the Source property on the image control.

    It's probably easier if you download the source code and make the modifications to support your requirements.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by babloo1436 Friday, February 8, 2013 7:00 AM
    • Marked as answer by kharolJ Sunday, February 10, 2013 11:30 AM
    Friday, February 8, 2013 6:32 AM
    Moderator

All replies

  • I think you would need to modify the shell to use your agency logo image saved in the db based on the user.  This also means you would need to access and assign users to organizations.  Something like this may help.  It is certainly possible, but I get chills at the idea of sharing one LS app between different organizations, particularly if confidentiality is an issue. 
    Friday, February 8, 2013 4:06 AM
  • Hi Hessc,

    Maybe I'm just imagining my app too far from reality, but I think everything is possible in the world of computer programming.  Sharing a single  app to different organization is not new at all, I believe there were lots of developers who already did this.  And as far as confidentiality of data is concerend, perhaps designing a perfect query to filter the data by organization is enough control to data access.

    Going back to my issue, I was thinking that since "application logo" is part of the general property of an application, I can prorammaticaly manipulate it without drilling deep inside the application shell.  I was looking at this thread by Yann.  What is the right way to show version information in a LS app

    kharolj


    Friday, February 8, 2013 6:10 AM
  • You won't be able to change the logo at runtime very easily. There is no API that will allow you to change it. It's possible that you could use the VisualTreeHelper to crawl down the visual tree until you find it and then change the the Source property on the image control.

    It's probably easier if you download the source code and make the modifications to support your requirements.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by babloo1436 Friday, February 8, 2013 7:00 AM
    • Marked as answer by kharolJ Sunday, February 10, 2013 11:30 AM
    Friday, February 8, 2013 6:32 AM
    Moderator
  • KharolJ,

    By all means go for it!  I can see some scenarios where multi-org could be good.  If they are sharing data between and some row level security is all that is needed then sure.  In other scenarios, I think it would be more trouble than it's worth.  But I agree, it is possible. 

    Saturday, February 9, 2013 7:15 PM