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

  • Home
  • SEARCH
  • 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 6724825
In Process

The Archive Base Latest Questions

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

I have a solution that I use but that one is not really giving

  • 0

I have a solution that I use but that one is not really giving me all the abilities that I need.

Right now, I’m setting the background of my Grid control to a VisualBrush that contains an ellipse on its Visual container. This makes it impossible for me to set a background color(or at least with my knowledge until now) BEHIND the drawn squares.

I am using these squares as markers for my snap to position functionality. See pic.

https://i.stack.imgur.com/J9CZf.jpg

Is there a possible way for me to keep my background pattern and also be able to set a background color? Another approach are also welcome as I feel like I have snowed in on this one because it works(partially).

Due to demand:

  brush = new VisualBrush();
  brush.Stretch = Stretch.Fill;
  brush.TileMode = TileMode.Tile;
  brush.Viewport = new Rect(0, 0, SnapDistance, SnapDistance);
  brush.ViewportUnits = BrushMappingMode.Absolute;
  brush.Viewbox = new Rect(0, 0, SnapDistance, SnapDistance);
  brush.ViewboxUnits = BrushMappingMode.Absolute;
  ellipse = new Ellipse() { Fill = new SolidColorBrush(Colors.Blue), Width = 2, Height = 2 };
  brush.Visual = ellipse;

This is what I set to the grid.Background. What I want to do is to draw the pattern I show in the link and also be able to set a color to the background with the dot pattern on that.

  • 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:44:07+00:00Added an answer on May 26, 2026 at 9:44 am

    You can overlay the grid with Canvas with the snap points or you can create an adorner layer with the snap points.

    Cite from MSDN page

    Adorners are a special type of FrameworkElement, used to provide visual cues to a user. Among other uses, Adorners can be used to add functional handles to elements or provide state information about a control.

    So the controls layout (in Z-order) will be:

    • the grid
    • the overlay with the snap points (don’t know how the events will be handled then)
    • your elements

    or

    • the grid
      • the adorner layer
    • your elements
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a solution but it is one that I know is not the
I have a solution with about 20 projects (that use Devexpress controls) in and
I have two tabbar items(views) that use the same data, whats the best solution
I have a page layout that I use in my SharePoint solution when I
I have a solution in VS 2008 that creates a DLL. I then use
I have a solution that is missing a lot of code coverage. I need
I have a solution that contains two projects. One project is an ASP.NET Web
I have been maintaining an installation for a while but I am not really
I know, that I am not the first one to try to use Cocoa
I have a solution that is deployed using ClickOnce. It consists of an application,

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.