Click here to Skip to main content
15,886,713 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
For some buttons based on the user, we used to set previlege.for that we have 2 functions.
Our requirement is, we need to convert the toolbar to DLL. we converted the toolbar except the database-dependent function addbutton, visible button in the below example.
so after conversion we inherited the dll in a class called 'BaseToolBar'.

Now my problem is i can't use the class 'Basetoolbar' in another form.it prompt the error like can't create instance. but instead of Dll inherited class, if we inherited normal class it's working.
Kindly provide any solution for that

Imports Toolbar

 Public Class BaseToolBar
     Inherits UcBaseToolBar
     Public Overrides Function AddButtons(ByVal ButtonNames() As String, Optional ByVal formname As String = "")

     End Function

     Public Overrides Function VisibleButtons(ByVal ButtonNames() As String, Optional ByVal formname As String = "", Optional ByVal mnuName As String = "")

     End Function

 End Class


In the above example,
1. Toolbar is the DLL we created
2.UcBaseToolBar is the usercontrol which is in DLL class.we inherited in 'BaseToolBar' class
3.Now where ever the tool bar used in forms , we need to replace with the class 'BaseToolBar' like the below

<usercontrol x:class="test" xmlns:x="#unknown">
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
                 xmlns:y ="clr-namespace:Toolbar;assembly=Toolbar" 
                   xmlns:y1="clr-namespace:IT "
                 mc:Ignorable="d" 
                 d:DesignHeight="300" d:DesignWidth="300">
        <grid>
            <y1:basetoolbar xmlns:y1="#unknown"></y1:basetoolbar>
        </grid>
    </usercontrol>


this <y1:basetoolbar xmlns:y1="#unknown">line creates error


Thanks & Regards
jai
Posted
Updated 22-Dec-14 20:20pm
v5
Comments
Sergey Alexandrovich Kryukov 23-Dec-14 1:47am    
Let's read your post: ..." convert the toolbar to DLL", "we converted the toolbar except the database"... from this point, no need to read; it all sounds like complete gibberish. I wonder, do you understand yourself your own words?

You need to understand that the main modular concept of .NET is "assembly"; it's not so important if it is DLL or not. Working across assemblies is quite trivial and not really related to namespaces. XAML has special syntax for using types in some namespaces you develop...

—SA
Praveen Kumar Upadhyay 23-Dec-14 2:13am    
Are you able to use the dll in another form, means is it accessible?
jayayanthi jai 23-Dec-14 2:22am    
it is accessible in another class. But can't use the inherited class in another XAML form

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900