Click here to Skip to main content
15,887,683 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Advantages and disadvantage using sliverlight Pin
Teun L9-Dec-09 1:33
Teun L9-Dec-09 1:33 
AnswerRe: Advantages and disadvantage using sliverlight Pin
Abhinav S6-Dec-09 17:45
Abhinav S6-Dec-09 17:45 
GeneralRe: Advantages and disadvantage using sliverlight Pin
Kunal Chowdhury «IN»11-Dec-09 3:39
professionalKunal Chowdhury «IN»11-Dec-09 3:39 
AnswerRe: Advantages and disadvantage using sliverlight Pin
Michael Eber19-Jan-10 6:24
Michael Eber19-Jan-10 6:24 
QuestionWPF - staggering storyboard executions Pin
gritter27-Nov-09 16:59
gritter27-Nov-09 16:59 
AnswerRe: WPF - staggering storyboard executions Pin
gritter28-Nov-09 3:05
gritter28-Nov-09 3:05 
QuestionMDI type of application using WPF Pin
nilam247726-Nov-09 23:37
nilam247726-Nov-09 23:37 
QuestionWPF UserControl Inheritance in VB.NET? Pin
ThisIsJustAPunkRockSong25-Nov-09 23:08
ThisIsJustAPunkRockSong25-Nov-09 23:08 
Hello all of you,

I have a problem and would be glad if you could help me.

What I need to know is how to archieve UserControl inheritance with VB. I found some samples how to do this with C# and all of them work fine with C#. But when I try to translate this in VB I get an error (namespace not found) in my UserControl-XAML.

e.g. this link, Variant 1:
http://svetoslavsavov.blogspot.com/2009/09/user-control-inheritance-in-wpf.html

It seems to be easy in C# and impossible with VB.

This is my approach:
1) the class "TestBaseCtrl.vb"
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
 
Namespace UserControlInheritance
    Public Class TestBaseCtrl
        Inherits UserControl
        
    End Class
End Namespace


2) the UserControl "InheritedUserControl.xaml"
<local:TestBaseCtrl x:Class="UserControlInheritance.InheritedUserControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:UserControlInheritance"
    Height="300" Width="300">
    <Grid>
        
    </Grid>
</local:TestBaseCtrl>



3) the code-behind "InheritedUserControl.xaml.vb"
Imports System
Imports System.Collections.Generic
Imports System.Linq
Imports System.Text
Imports System.Windows
Imports System.Windows.Controls
Imports System.Windows.Data
Imports System.Windows.Documents
Imports System.Windows.Input
Imports System.Windows.Media
Imports System.Windows.Media.Imaging
Imports System.Windows.Navigation
Imports System.Windows.Shapes
 
Namespace UserControlInheritance
    ''' <summary>
    ''' Interaction logic for InheritedUserControl.xaml
    ''' </summary>
    Partial Public Class InheritedUserControl
        Inherits TestBaseCtrl
 
        Public Sub New()
            InitializeComponent()
        End Sub
 
        
    End Class
End Namespace



My (german) error message is the following:
"Der local:TestBaseCtrl-Typ wurde nicht gefunden. Alle Assemblyverweise müssen vorhanden sein, und alle Assemblys, auf die verwiesen wird, müssen erstellt worden sein."

in english something like this:
"The local.TestBastCtrl-type was not found. All assembly references have to exist and all assemblys, that are referenced, have to be built."

--> It seems to me that the compiler does not find the class in my namespace but I can assure that the namespace is as correct as it is in the C#-project.

Your help would be very much appreciated!

I need a UserControl to inherit from, there are several functions that should be integrated in all of my forms and I do not want to implement them in every form I want to create. Frown | :-(

If I get this working, I hope that this kind of UserControls will still be working within the CAL (Composite Application Libary)-Framework, but this will be another story for another day...
Questionpolicy issue Pin
Tauseef A25-Nov-09 10:28
Tauseef A25-Nov-09 10:28 
AnswerRe: policy issue Pin
Mark Salsbery25-Nov-09 10:54
Mark Salsbery25-Nov-09 10:54 
QuestionRe: policy issue Pin
Tauseef A25-Nov-09 19:44
Tauseef A25-Nov-09 19:44 
AnswerRe: policy issue Pin
Mark Salsbery25-Nov-09 20:38
Mark Salsbery25-Nov-09 20:38 
QuestionRe: policy issue Pin
Tauseef A25-Nov-09 23:36
Tauseef A25-Nov-09 23:36 
AnswerRe: policy issue Pin
Tauseef A25-Nov-09 23:44
Tauseef A25-Nov-09 23:44 
GeneralRe: policy issue Pin
Mark Salsbery26-Nov-09 7:50
Mark Salsbery26-Nov-09 7:50 
GeneralRe: policy issue Pin
Tauseef A29-Nov-09 16:48
Tauseef A29-Nov-09 16:48 
QuestionProblem with ScreenSpaceLines3D Pin
Alaajabre25-Nov-09 1:04
Alaajabre25-Nov-09 1:04 
Questionwpf 3d transparency Pin
wpftester25-Nov-09 0:52
wpftester25-Nov-09 0:52 
AnswerRe: wpf 3d transparency Pin
Pete O'Hanlon25-Nov-09 1:47
mvePete O'Hanlon25-Nov-09 1:47 
QuestionGetting Started - WPF/ WCF/ WWF Pin
Anoop Brijmohun24-Nov-09 22:43
Anoop Brijmohun24-Nov-09 22:43 
AnswerRe: Getting Started - WPF/ WCF/ WWF Pin
Mark Salsbery25-Nov-09 15:55
Mark Salsbery25-Nov-09 15:55 
AnswerRe: Getting Started - WPF/ WCF/ WWF Pin
sisvis26-Nov-09 2:56
sisvis26-Nov-09 2:56 
QuestionWPF Table control Pin
Nekkantidivya24-Nov-09 1:07
Nekkantidivya24-Nov-09 1:07 
AnswerRe: WPF Table control Pin
Mark Salsbery24-Nov-09 6:57
Mark Salsbery24-Nov-09 6:57 
GeneralRe: WPF Table control Pin
Nekkantidivya24-Nov-09 17:00
Nekkantidivya24-Nov-09 17:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.