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 8100095
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T22:39:07+00:00 2026-06-05T22:39:07+00:00

There is an very old WPF application of Hyper Tree – http://blogs.msdn.com/b/llobo/archive/2007/10/31/mindmap-app-using-hyperbolic-tree.aspx . The

  • 0

There is an very old WPF application of Hyper Tree – http://blogs.msdn.com/b/llobo/archive/2007/10/31/mindmap-app-using-hyperbolic-tree.aspx.

The source code can be found at codeplax.com –
http://hypertree.codeplex.com/releases/view/11524

I wanted to use this tree control in my silverlight application. Now the issue is that i am new to silverlight, and the code is using some WPF specific things.

Please suggest me to solve my problem.

Thanks in advance.

Abhinav

Update:

things like
FrameworkPropertyMetadata and FrameworkPropertyMetadataOptions, InvalidateVisual(), OnRender override, child UIElements.

Code Added:

public class SmartBorder : Decorator
{
    #region Dependency Properties
    public static readonly DependencyProperty GlowBrushProperty =
        DependencyProperty.Register("GlowBrush", typeof(Brush), typeof(SmartBorder), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.AffectsRender));

  ......

    #region Dependency Property backing CLR properties
......
    #endregion

    // if the button is pressed, this fires
    private static void OnRenderIsPressedChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
    {
        SmartBorder border = o as SmartBorder;
        if (border != null)
        {
            if ((bool)e.NewValue == true)
            {
                border.BorderBrush = Brushes.Transparent;
                border.BorderWidth = 2;
            }
            else
            {
                border.BorderBrush = Brushes.Red;
                border.BorderWidth = 2;

            }
            border.InvalidateVisual();
        }
    }

    // if the mouse is over the control, this fires
    private static void OnRenderIsMouseOverChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)
    {
        SmartBorder border = o as SmartBorder;
        if (border != null)
        {
            border.InvalidateVisual();
        }

    }

    // a series of methods which all make getting the default or currently selected brush easier


    protected override void OnRender(DrawingContext dc)
    {
        Rect rc = new Rect(0, 0, this.ActualWidth, this.ActualHeight);

        LinearGradientBrush gradientOverlay = GetGradientOverlay();
        Brush glowBrush = GetGlowBrush();
        Brush backBrush = GetBackgroundBrush();
        Brush borderBrush = GetBorderBrush();
        Pen borderPen = new Pen(borderBrush, BorderWidth);
        double cornerRadiusCache = CornerRadius;

        // draw the highlight as necessary
        if (RenderIsMouseOver)
        {
            Rect rcGlow = rc;
            double glowMove = BorderWidth * 2;
            rcGlow.Inflate(glowMove, glowMove);
            glowMove = 0;
            rcGlow.Offset(new Vector(glowMove, glowMove));
            dc.DrawRoundedRectangle(GetOuterGlowBrush(), null, rcGlow, cornerRadiusCache, cornerRadiusCache);
        }

        // we want to clip anything that might errantly draw outside of the smart border control
        dc.PushClip(new RectangleGeometry(rc, cornerRadiusCache, cornerRadiusCache));

        dc.DrawRoundedRectangle(backBrush, borderPen, rc, cornerRadiusCache, cornerRadiusCache);
        dc.DrawRoundedRectangle(gradientOverlay, borderPen, rc, cornerRadiusCache, cornerRadiusCache);

        if (!RenderIsPressed)
        {
            double clipBorderSize = BorderWidth * -4.0;
            Rect rcClip = rc;
            rcClip.Offset(clipBorderSize, clipBorderSize);
            rcClip.Inflate(-clipBorderSize, -clipBorderSize);
            dc.PushClip(new RectangleGeometry(rcClip, cornerRadiusCache, cornerRadiusCache));
            dc.DrawEllipse(glowBrush, null, new Point(this.ActualWidth / 2, this.ActualHeight * 0.10), this.ActualWidth * 0.80, this.ActualHeight * 0.40);
            dc.Pop();
        }
        // just draw the border now to make sure it overlaps everything nicely
        dc.DrawRoundedRectangle(null, borderPen, rc, cornerRadiusCache, cornerRadiusCache);

        dc.Pop();
        //base.OnRender(drawingContext);
    }


    protected override Size MeasureOverride(Size constraint)
    {
        UIElement child = this.Child as UIElement;

        double borderThickness = BorderWidth * 2.0;

        if (child != null)
        {

    ...
        }

        return new Size(Math.Min(borderThickness, constraint.Width), Math.Min(borderThickness, constraint.Height));
    }
}
  • 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-06-05T22:39:08+00:00Added an answer on June 5, 2026 at 10:39 pm

    Regarding FrameworkPropertyMetadata and FrameworkPropertyMetadataOptions and value coercions etc. for Silverlight see the WPF_Compatibility solution under the ClipFlair codebase (http://clipflair.codeplex.com)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm upgrading a very old (10+ years) application to the latest Delphi XE. There
Setting up environment variables for hundreds of tests get old very quick. Is there
I was downloading an Pizza pizza application for IPhone. There is very cool animation
There are a lot of such classes in my project (very old and stable
I have a customer (a very old person) who wants an application that has
I've got a very old php application (1999) that has been worked on during
I am trying to run our very old application on Windows 7 64 bit.
I have a git repository, and a very old patch (made in 2007) that
We have very old application deployed in Linux server. We are using the RollingFileAppender
I have a very old application that now needs to be friendly to Windows

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.