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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T08:18:10+00:00 2026-05-17T08:18:10+00:00

I have a resource (myPoint) defined in XAML as follows: <Path Name=myPath> <Path.Resources> <Point

  • 0

I have a resource (myPoint) defined in XAML as follows:

<Path Name="myPath">
   <Path.Resources>
      <Point x:Key="myPoint" X="200" Y="200"/>
   </Path.Resources>
</Path>

In the OnApplyTemplate override in the corresponding C# code, I use the following to get a reference to this resource.

myPointReference = (Point)myPath.FindResource("myPoint");

Now, whenever I modify the value of myPointReference, let’s say,

myPointReference.X = 30;

it doesn’t modify the value of the resource myPoint, it only changes the value of myPointReference. How can I make myPointReference an actual reference to my XAML defined resource myPoint so that when I modify the value of myPointReference, I am also modifying the value of myPoint?

  • 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-17T08:18:10+00:00Added an answer on May 17, 2026 at 8:18 am

    Under the covers when you use the Resources extension in XAML you are dealing with a ResourceDictionary and you are dealing with adding a struct (aka value type) to this which will be passed by value (aka copied) into this dictionary, and then when you request it you will be returned a copy.

    There is no way to pass value types by reference when dealing with a ResourceDictionary.

    However, if you really need to do this after you modify your copy you can replace the old copy in the dictionary with your modified copy.

    You can try this by calling:

    myPath.SetResourceReference("myPoint", myPointReference)
    

    You may want to consider not doing this in XAML or using a ResourceDictionary. You can just manage the Point in the code behind only and update it and set it to the Path as needed.

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

Sidebar

Related Questions

I have a resource defined in my Xaml file as follows: <Path x:Key=myPath Data=M14.773241,18.080208
I have a resource defined in my routes file as follows: resources :accounts, :only
I have this resource file for colors <resources> <color name=CLR_BLUE>#00f</color> <color name=CLR_RED>#f00</color> <color name=CLR_GREEN>#0f0</color>
I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in
I have a resource database where resources can belong to different locations. Users and
Say I have resource defined as /thing/{id}/ and my id is a int in
I have a resource exposed with two actions ONLY ('name' and 'number') and I
if i have tabled: Resource (id (PK), name) Manager (id(PK), resource_id (FK), manager_resource_ID(FK)) Should
I have 2 resource file : Resources.resx (has some strings in Romanian) and Resources.en-US.resx
I have a resource 'Post' in my app. The default routes for resources :posts

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.