Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6719759
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:07:51+00:00 2026-05-26T09:07:51+00:00

I have a bunch of items in my viewmodel that I’m going to render

  • 0

I have a bunch of items in my viewmodel that I’m going to render in 3D using a Viewport3D. The relevant pieces of the UI is defined as such:

<Viewport3D x:Name="viewport">
    <Viewport3D.Children>
        <!-- This is my custom control, deriving from UIElement3D -->
        <local:myCollectionVisualizer Items="{Binding MyItems}" />
    </Viewport3D.Children>
</Viewport3D>

(I omitted light and camera from the xaml above but of course that’s also there in my code)

Now I would like my custom control to render all the items (from the Items dependency property that I’ve defined) as individual UIElement3D elements positioned at the location specified by their bound object.

My approach so far is to override the GetVisual3DChild and related methods/properties to setup the parent-child relationship for my items. The problem I’m facing is how to data bind the child’s translation transform to the values defined in my bound object – Since UIElement3D doesn’t derive from FrameworkElement, there is no SetBinding method and thus no apparent way to specify the binding from code.

Note that binding the transform works fine in XAML:

<Viewport3D x:Name="viewport">
    <Viewport3D.Children>
        <perspective:Spherical3D>
            <perspective:Spherical3D.Transform>
                <Transform3DGroup>
                    <!-- This works fine! -->
                    <TranslateTransform3D OffsetX="{Binding X}" 
                                          OffsetY="{Binding Y}" 
                                          OffsetZ="{Binding Z}" />
                </Transform3DGroup>
            </perspective:Spherical3D.Transform>
        </perspective:Spherical3D>
    </Viewport3D.Children>
</Viewport3D>

How can I create the above binding from code, when I don’t have access to FrameworkElement.SetBinding?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T09:07:51+00:00Added an answer on May 26, 2026 at 9:07 am

    I found the answer to my own question so I’m posting it here for the benefit of others finding this page later.

    To create a binding on a dependency property on something which isn’t a framework element, you use the static BindingOperations.SetBinding method. In my case, the end result was something like this:

    var visual = new Spherical3D();
    var tx = new TranslateTransform3D();
    BindingOperations.SetBinding(tx, TranslateTransform3D.OffsetXProperty, 
                                 new Binding("X") { Source = myDataObject });
    BindingOperations.SetBinding(tx, TranslateTransform3D.OffsetYProperty, 
                                 new Binding("Y") { Source = myDataObject });
    BindingOperations.SetBinding(tx, TranslateTransform3D.OffsetZProperty, 
                                 new Binding("Z") { Source = myDataObject });
    visual.Transform = tx;
    Children.Add(visual);
    AddVisual3DChild(visual);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of items (text, image, mixed content, etc) that I want
I have a Django website that basically just displays a bunch of items from
In a Qt application, I have a bunch of automatically-created QActions (menu items) that
I have a bunch of items that I have grouped up by Header. I
so I have a bunch of drupal MENU_LOCAL_TASK menu items that gets displayed as
I have a bunch of items in my program that all belong to a
I have a bunch of items with the same class that when selected open
I have a GridView that lists a bunch of items and one of the
I have a bunch of items with class dof that are shown and hidden
I have a bunch of li items that have some custom attributes: <ul> <li

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.