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
    2004-06
    Location
    Port Moody, BC
    Posts
    336
    0 Did you find this post helpful? Yes

    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?

    Thanks,

    Drew
    Last edited by drewj; 2013-11-14 at 06:51 PM.
    Drew Jarvis
    Applications Specialist - Cansel
    Vancouver. BC

  2. #2
    I could stop if I wanted to
    Join Date
    2004-06
    Location
    Port Moody, BC
    Posts
    336
    0 Did you find this post helpful? Yes

    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
    win.Show()

    so maybe I will give that a try...
    Drew Jarvis
    Applications Specialist - Cansel
    Vancouver. BC

  3. #3
    Programming Moderator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    3,416
    0 Did you find this post helpful? Yes

    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.

    HTH

    ts_wpfp.sample.awesome.tab.png
    "Potential has a shelf life." - Margaret Atwood

    Autodesk Exchange Apps
    ~ Autoloader ~ AutoCAD Security

Similar Threads

  1. 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
  2. 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
  3. Replies: 0
    Last Post: 2012-01-05, 11:15 AM
  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
  •