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
    349
    Login to Give a bone
    0

    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 07:51 PM.

  2. #2
    I could stop if I wanted to
    Join Date
    2004-06
    Location
    Port Moody, BC
    Posts
    349
    Login to Give a bone
    0

    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...

  3. #3
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    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
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

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 autocad.wishlist1734 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
  •