How to hide layer in legend and on the map?

Discussion created by aviabunin on Dec 31, 2014

Dear Gurus!

    In xaml or in code I create layers for the findTask or somethink else, for example:



        <esri:Map x:Name="myMap"  >
            <esri:ArcGISDynamicMapServiceLayer ID="BaseLayer" 
                            Url="http://localhost:6080/ArcGIS/rest/services/streetRK/MapServer" />

                <esri:FeatureLayer    ID="bridges"                             
                            Url="http://localhost:6080/ArcGIS/rest/services/streetRK/MapServer/2"  >
            <esri:GraphicsLayer ID="MyGraphicsLayer"  />

or in code:

            FeatureLayer fLayer = new FeatureLayer();
            fLayer.Url = "http://localhost:6080/ArcGIS/rest/services/streetRK/MapServer/1";
            fLayer.ID = "routes_new";


How can I make this layers does not appear  in the legend or in the map object?