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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:54:06+00:00 2026-05-24T04:54:06+00:00

There is a need to provide some sort of interface(save/edit/load) to dynamically generated styles

  • 0

There is a need to provide some sort of interface(save/edit/load) to dynamically generated styles that are formed from GeometryDrawings. The problem is distinction between them in situation they lack Name property. I’ve tried something like this :

// some dummy predefined style, it has more drawings but i keep first one
const string templateXaml = @"<DrawingBrush xmlns=""http://schemas.microsoft.com/winfx/2006/xaml/presentation"" xmlns:x=""http://schemas.microsoft.com/winfx/2006/xaml"" Stretch=""Uniform"">
                <DrawingBrush.Drawing>
                    <DrawingGroup>
                        <DrawingGroup.Children>
                            <GeometryDrawing Geometry=""F1 M 77,92L 704,92L 704,517L 77,517L 77,92 Z "" x:Name=""test_name"">
                                <GeometryDrawing.Pen>
                                    <Pen Thickness=""4"" LineJoin=""Round"" Brush=""#FFFF7D00""/>
                                </GeometryDrawing.Pen>
                            </GeometryDrawing>
    <!--More drawings here -->
                            </DrawingGroup.Children>
                    </DrawingGroup>
                </DrawingBrush.Drawing>
            </DrawingBrush>";
        var drawingBrush = XamlReader.Parse(templateXaml) as DrawingBrush;
        var firstDrawing = (drawingBrush.Drawing as DrawingGroup).Children[0] as GeometryDrawing;
        //..
        var name = firstDrawing.GetValue(NameProperty);
        //..
        firstDrawing.SetValue(FrameworkElement.NameProperty, "some value");

I would like to have x:Name here in name variable (or something like this) to be able to change it and than serialize to get, for example, the same style but with different names for drawings (case is now they are named Element1,2,3…, and have to be named according to subject area, and that processing have to be automatic but not manual regarding the fact there is no ability to WYSIWYG’ly do that – each Drawing is put into Visual, Visuals are put into custom FrameworkElement etc.). Of course, the whole process of working with Drawings is a pain, but that is a system design requirement i can’t ignore. Thanks in advance.

  • 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-24T04:54:07+00:00Added an answer on May 24, 2026 at 4:54 am

    Didn’t find better way than wrap drawings in BL classes and serialize/deserialize them. Lost consistency and violated requirements a bit – now i have two entities (plain geometries and classes that describes them) representing graphical objects, but they can be converted/interchanged when needed.

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

Sidebar

Related Questions

I need a user interface that allows users to sort a table according to
So are there any available in the SL4? I need to display some sort
Is there any way to provide user log-in without the need for a DB.
Hi There I need to get the names and values of checkboxes that have
There is a need from a customer to log every data change to a
Almost every project that I work will have some sort of tab delimited file
I need to implement an OpenID Provider in .Net and wondered....Is there's any OpenSource
There is need for quering NHibernate for several instances of the entity. I've tried
Is there any need for code with author's name added in every function or
Why is there a need to convert a value (for example short) to string,

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.