Results 1 to 3 of 3

Thread: WPF user control instead of a Winform

  1. #1
    I could stop if I wanted to
    Join Date
    Port Moody, BC

    Default WPF user control instead of a Winform

    I would like to test WPF as an improvement to Winforms (I think I have the correct terms)

    So I tried the following:

    I created an Addin
    I inserted a WPF user control as its the only thing available under WPF
    I then added imports System.Windows the xaml.vb and within the class Inherits window
    this allows me to treat the WPF user control as a window so that I can use .ShowDialog() to get it open

    But I get the following error:

    Error 1 Base class 'System.Windows.Controls.UserControl' specified for class 'Home' cannot be different from the base class 'System.Windows.Window' of one of its other partial types.

    the System.Windows.Controls.UserControl is automatically generated in a file named Home.g.vb

    so to my question

    I guess that adding a user control is different to a form, which is what I want..... so is there some documentation out there about adding a WPF form to a revit api?


    Last edited by drewj; 2013-11-14 at 07:51 PM.

  2. #2
    I could stop if I wanted to
    Join Date
    Port Moody, BC

    Default Re: WPF user control instead of a Winform

    I see I may be able to load the user control into a window with:

    Dim userControl As New UserControl1()
    Dim win As New Window()
    win.Content = userControl

    so maybe I will give that a try...

  3. #3
    Programming Moderator BlackBox's Avatar
    Join Date

    Default Re: WPF user control instead of a Winform

    Hi Drew,

    Sounds like you're wanting to host a WPF UserControl within a PalettSet, in which case, consider Kean's article here as a loosely related reference.

    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Autodesk Exchange Apps

Similar Threads

  1. Release a .dll with a WinForm
    By sherlock_62_m549011 in forum Dot Net API
    Replies: 1
    Last Post: 2014-11-16, 03:36 PM
  2. AB104-3: AutoCAD Architecture: Display Control for the Common User
    By Autodesk University in forum Building Design
    Replies: 0
    Last Post: 2013-05-05, 03:13 AM
  3. Give the user more control
    By Wish List System in forum Revit MEP - Wish List
    Replies: 1
    Last Post: 2012-03-29, 02:11 PM
  4. User-created phase filter won't control linked file
    By petervanko in forum Revit Architecture - General
    Replies: 3
    Last Post: 2010-10-25, 05:44 PM
  5. User Customizable Width Property for Toolbar Control Boxes
    By acadwishlist in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2008-06-11, 10:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts