Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

Cleaning up app.xaml? RSS

5 replies

Last post Jan 12, 2011 01:02 PM by geedubb

(0)
  • geedubb

    geedubb

    Member

    680 Points

    143 Posts

    Cleaning up app.xaml?

    Jan 09, 2011 02:23 PM | LINK

    An application that I'm currently doing some work on has a huge app.xaml file.

    It seems to have been poorly maintained over the years and I feel has a lot of redundant styling info in it.

    Can anyone recommend a tool or process to weed out the unused styles, or do I have to bite the bullet and go for trial and error?(!)

    Thanks

    twitter.com/garethwatt
  • amyo

    amyo

    Star

    8312 Points

    1083 Posts

    Re: Cleaning up app.xaml?

    Jan 09, 2011 03:47 PM | LINK

    You can use Visual Studio search function.

    1.Collapse all Style in App.xaml

    2. Copy each key and then search

    -Find In Files

    -Look in: Current Project

    3. If result count 0 then surely you can delete that style.

  • geedubb

    geedubb

    Member

    680 Points

    143 Posts

    Re: Cleaning up app.xaml?

    Jan 09, 2011 09:20 PM | LINK

    Thanks for the reply - but this is kind of a manual approach which I want to avoid if possible.

    My app.xaml file is around 6,000 lines and it's a pretty big application :(

    I like the idea of collapsing the definitions - this will help a bit if I do it by hand.


    twitter.com/garethwatt
  • amyo

    amyo

    Star

    8312 Points

    1083 Posts

    Re: Cleaning up app.xaml?

    Jan 10, 2011 07:22 AM | LINK

    I wish Visual Studio tools for Silverlight 5 will have some feature that will highlight if the style is not in use!

    Moreover, you can split your style in different resource file for better maintenance.



  • Daoping Liu - MSFT

    Daoping Liu...

    All-Star

    15960 Points

    2045 Posts

    Microsoft

    Re: Cleaning up app.xaml?

    Jan 12, 2011 10:55 AM | LINK

    Hi,

    geedubb

    but this is kind of a manual approach which I want to avoid if possible.

    But I do think amyo's approach is good thus far.

    So, you can try it.

     

    Regards

    Please mark the replies as answers if they help or unmark if not.
    If you have any feedback about my replies, please contact msdnmg@microsoft.com.
    Microsoft One Code Framework
  • geedubb

    geedubb

    Member

    680 Points

    143 Posts

    Re: Re: Cleaning up app.xaml?

    Jan 12, 2011 01:02 PM | LINK

    Yeah


    Thanks for taking the time to reply guys


    Cheers

    twitter.com/garethwatt