This is a migrated thread and some comments may be shown as answers.

ContextMenu is null with application library caching

1 Answer 76 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Mike
Top achievements
Rank 1
Mike asked on 30 Oct 2011, 05:08 PM
After adding a host of Telerik Silverlight components to my app it's gone  from 600KB to more than 4MB resulting in a number of loading errors for users. I thought I would take advantage of library caching to reduce the size of the XAP and improve performance. 

After choosing to "Reduce XAP size by using Application Library Caching" and building, the external assemblies are zipped appropriately and downloaded, but the RadRichTextBox Context Menu is null after startup nonetheless. 

Here's the XAML for the richtexbox 
<telerik:RadRichTextBox HorizontalAlignment="Stretch" MinHeight="100" KeyDown="RadRichText_KeyDown"  IsEnabled="true" Name="RadRichText" Margin="0, 0, 0, 10" Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="4" ToolTipService.ToolTip="type or paste your idea, question, or observation"  BorderThickness="0" Visibility="Visible" Padding="10, 10, 40, 10" DocumentContentChanged="RadRichText_DocumentContentChanged" DocumentInheritsDefaultStyleSettings="True" HorizontalScrollBarVisibility="Hidden" IsContextMenuEnabled="True" IsSelectionMiniToolBarEnabled="False" IsSpellCheckingEnabled="True" VerticalScrollBarVisibility="Hidden" />
                        <my:TxtDataProvider Name="RadTextData" RichTextBox="{Binding ElementName=RadRichText}"  />


and here's the code behind that results in a null reference

void PostControl_Loaded(object sender, RoutedEventArgs e)
        {
            if (!System.ComponentModel.DesignerProperties.IsInDesignTool)
            {
                PopulateLibraryDropDown();
                var menu = (Telerik.Windows.Controls.RichTextBoxUI.ContextMenu)this.RadRichText.ContextMenu;
                menu.Showing += new EventHandler<Telerik.Windows.Controls.RichTextBoxUI.Menus.ContextMenuEventArgs>(menu_Showing);
 
 
            }
        }

Finally, here's the list of assemblies in the manifest. 
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" EntryPointAssembly="SnapTeam" EntryPointType="SnapWorkSocial.SnapTeam.App" RuntimeVersion="4.0.50826.0">
  <Deployment.Parts>
    <AssemblyPart x:Name="SnapTeam" Source="SnapTeam.dll" />
    <AssemblyPart x:Name="Microsoft.SharePoint.Client.Silverlight" Source="Microsoft.SharePoint.Client.Silverlight.dll" />
    <AssemblyPart x:Name="Microsoft.SharePoint.Client.Silverlight.Runtime" Source="Microsoft.SharePoint.Client.Silverlight.Runtime.dll" />
    <AssemblyPart x:Name="System.Windows.Controls.Input.Toolkit" Source="System.Windows.Controls.Input.Toolkit.dll" />
    <AssemblyPart x:Name="System.Windows.Controls.Toolkit" Source="System.Windows.Controls.Toolkit.dll" />
  </Deployment.Parts>
  <Deployment.ExternalParts>
    <ExtensionPart Source="System.ComponentModel.Composition.zip" />
    <ExtensionPart Source="System.ComponentModel.DataAnnotations.zip" />
    <ExtensionPart Source="System.Json.zip" />
    <ExtensionPart Source="System.ServiceModel.Syndication.zip" />
    <ExtensionPart Source="System.Windows.Controls.Data.Input.zip" />
    <ExtensionPart Source="System.Windows.Controls.zip" />
    <ExtensionPart Source="System.Windows.Controls.Input.zip" />
    <ExtensionPart Source="System.Windows.Controls.Navigation.zip" />
    <ExtensionPart Source="System.Windows.Data.zip" />
    <ExtensionPart Source="System.Xml.Linq.zip" />
    <ExtensionPart Source="System.Xml.Serialization.zip" />
    <ExtensionPart Source="Telerik.Windows.Controls.zip" />
    <ExtensionPart Source="Telerik.Windows.Controls.Input.zip" />
    <ExtensionPart Source="Telerik.Windows.Controls.Navigation.zip" />
    <ExtensionPart Source="Telerik.Windows.Controls.RichTextBoxUI.zip" />
    <ExtensionPart Source="Telerik.Windows.Data.zip" />
    <ExtensionPart Source="Telerik.Windows.Documents.zip" />
    <ExtensionPart Source="Telerik.Windows.Documents.Proofing.Dictionaries.En-US.zip" />
    <ExtensionPart Source="Telerik.Windows.Controls.RibbonBar.zip" />
    <ExtensionPart Source="Telerik.Windows.Controls.ImageEditor.zip" />
  </Deployment.ExternalParts>
</Deployment>

Thank you for your help
-mike

1 Answer, 1 is accepted

Sort by
0
Mike
Top achievements
Rank 1
answered on 30 Oct 2011, 06:03 PM
Tags
RichTextBox
Asked by
Mike
Top achievements
Rank 1
Answers by
Mike
Top achievements
Rank 1
Share this question
or