class library inheritance

4 posts, 0 answers
  1. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 03 Mar 2011 Link to this post

    i like to create dialogs by inheriting a radwindow.
    <telerik:RadWindow x:Class="agClassLibrary.TraceWindow"
        MinWidth="400" MinHeight="250"
        mc:Ignorable="d" d:DesignHeight="250" d:DesignWidth="400">
        <Grid x:Name="LayoutRoot" Background="White">
            <ListBox Name="lbMessage" >
    Imports System.Windows.Data
    Imports Telerik.Windows.Controls
    Imports System.ComponentModel
    Imports System.ComponentModel.DataAnnotations
    Imports System.Collections.ObjectModel
    Imports agClassLibrary
    Imports System.Linq
    Imports System.ServiceModel.DomainServices.Client
    Imports System.Runtime.CompilerServices
    Partial Public Class TraceWindow
        Inherits RadWindow
        Protected lstMessages As New ObservableCollection(Of String)
        <Display(Name:="MaxMessages", Description:="MaxMessages")> _
        Public Property MaxMessages() As Integer
                Return _MaxMessages
            End Get
            Set(ByVal value As Integer)
                _MaxMessages = value
            End Set
        End Property
        Protected _MaxMessages As Integer = 500
        Public Sub New()
            lbMessage.ItemsSource = lstMessages
        End Sub
        Protected Sub AddMessage(ByVal message As String)
            Dim TraceMessage As String = Now & " --> " & message
        End Sub
        Public Sub Trace(ByVal EntitySet As EntitySet)
            Trace(EntitySet.EntityType.ToString & ":" & EntitySet.Count)
        End Sub
        Public Sub Trace(ByVal message As String)
            If lbMessage.Items.Count > MaxMessages Then
            End If
            lbMessage.ScrollIntoView(lbMessage.Items(lbMessage.Items.Count - 1))
        End Sub
    End Class

    This works fine if it is in the main silverlight project
    but if it is placed in a silverlight class library the Visual Studio Designer errs out.

    An unhandled exception was encountered while trying to render the current silverlight project on the design surface. To diagnose this failure, please try to run the project in a regular browser using the silverlight developer runtime.
       at Microsoft.Windows.Design.Platform.SilverlightViewProducer.OnUnhandledException(Object sender, ViewUnhandledExceptionEventArgs e)
       at Microsoft.Expression.Platform.Silverlight.SilverlightPlatformSpecificView.OnUnhandledException(Object sender, ViewUnhandledExceptionEventArgs args)
       at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
       at Microsoft.Expression.Platform.Silverlight.Host.SilverlightImageHost.<>c__DisplayClass1.<Application_UnhandledException>b__0(Object o)
       at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
       at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
    The Extender Provider failed to return an Extender for this object.
       at MS.Internal.XcpImports.CheckHResult(UInt32 hr)
       at MS.Internal.XcpImports.Collection_InsertValue[T](PresentationFrameworkCollection`1 collection, UInt32 index, CValue value)
       at MS.Internal.XcpImports.Collection_InsertDependencyObject[T](PresentationFrameworkCollection`1 collection, UInt32 index, DependencyObject value)
       at System.Windows.PresentationFrameworkCollection`1.InsertDependencyObject(Int32 index, DependencyObject value)
       at System.Windows.Controls.UIElementCollection.InsertInternal(Int32 index, UIElement value)
       at Microsoft.Expression.Platform.Silverlight.Host.SilverlightImageHost.SceneWrapper.set_SceneRoot(FrameworkElement value)
       at Microsoft.Expression.Platform.Silverlight.Host.SilverlightImageHost.set_RootInstance(Object value)

    I can work around it by just
    • not inheriting radwindow
    • creating a usercontrol and then
    • instantiating a radwindow
    • assigning the content of the radwindow to the usercontrol

    But i prefer seeing the radwindow border in the desginer
    is there anything obvious i am doing wrong


  2. Yana
    Yana avatar
    4547 posts

    Posted 09 Mar 2011 Link to this post

    Hello David Ocasio,

    I've tried to reproduce this issue but to no avail. I've attached my test projects, could you please download the attachment and examine it?

    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft R3 2016 release webinar banner
  4. David Ocasio
    David Ocasio avatar
    147 posts
    Member since:
    Nov 2009

    Posted 19 Mar 2011 Link to this post

    sorry so late for a continuation of the thread


    i think i have found the answer or at least a direction

    with the release of 2011 q1 i felt the need to remove all othe older versions of radcontrols instead of just upgrading the projects
    i also removed the extentions and deleted the roaming appdata telerik uses

    it seems for now that this is working
    i can now inhertit the radwindow and have it display in the designer properly

    if this changes of course i will be back lol

    thanks for your assitance
  5. Yana
    Yana avatar
    4547 posts

    Posted 21 Mar 2011 Link to this post

    Hello David Ocasio,

    I'm glad you managed to fix the problem.

    Please contact us again should you have any other issues.

    the Telerik team
Back to Top