(Thread looks long, but it's not)Hi all! Hope you are doing well...I came accross another problem, for which I need your confirmation, hints etc.I want to customize the whole layout, (like having the viewer's map object in a componentone dock-control's tab) but this doesn't work. Documentation says, viewer is open ended and can handle any kind of silverlight library, that's why I think I am doing something wrong..What I did:1.) I changed in rnd.Layouts.csproj file (Project Template for the Layout)<XapOutputs>false<XapOutputs>
to <XapOutputs>true<XapOutputs>
to get the xap generated.2.) I Added <Extension Url="Extensions/rnd.Layouts.xap" />
to Application.xml in the web project, so that this add-in is loaded by the viewer.3.) I Changed LayoutFilePath="Config/Layouts/Glass.xaml"
to LayoutFilePath="Config/Layouts/rnd.xaml"
in the file 'Application.xml' available in web project, so that my custom xaml is loaded by the viewer.The replacement of Glass.xaml (the LayoutFile) looks like:<UserControl
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400"
xmlns:rnd="clr-namespace:rnd.Layouts;assembly=rnd.Layouts"
>
<Grid x:Name="LayoutRoot">
<rnd:customLayout/>
</Grid>
</UserControl>
rnd.xaml file is created under Layouts folder in web project and loads the rest of my view from the assembly "rnd.Layouts"I might have forgotten a step or some, but the customLayout control which is in the rnd.Layouts project (called by rnd.xaml the LayoutFile) is loaded without any issue if some conditions are true, which no where are documented.My conclusion was:The object MapApplication.Current.Map
is not initialized when the map object like <esri:Map x:Name="Map"/>
is not added in the LayoutFile which Application.xml is pointing to (in Glass.xaml or rnd.xaml)For the map, the x:Name must be exactly like "Map" not "rndMap" or so, otherwise MapApplication.Current.Map
is not initialized.The customLayout UserControl contains the resource dictionary <extensibility:MapApplicationBindingSource x:Key="MapApplication" />
and all needed references etc. I read that the viewer is expecting some elements like <esri:Map x:Name="Map"/>
but there is nothing listed in the documentation.-What other elements are compulsory for the viewer what are their x:Name's?-Which Resourceses are compulsory by the viewer elements?-I would like to have different Views/UserControls in my Layout project, where I can nest the viewer elements into other custom Views/UserControls.-If there is no other option than initializing the viewer elements in the LayoutFile, how can I reuse them in another CustomControl/UserControl?Any help is highly appreciated...Many thanks for reading...