1) Get the last point in the path, or get the last linesegment in the path
where I could then get the last point.
2) Remove the last linesegment in the path
How can I do this?
any comments would be great. Thanks!
--
moon...@newsgroup.nospam
> I have a .net 3.0 wpf app and using c# I need to do 2 things:
>
> 1) Get the last point in the path, or get the last linesegment in the
> path
> where I could then get the last point.
>
> 2) Remove the last linesegment in the path
>
> How can I do this?
I'm just guessing, but looking at the docs (which is always a great place
to start when you have a question :) ), it looks to me as though you can
get a PathFigureCollection from your PathGeometry via the Figures
property. The collection offers the usual collection operations, such as
retrieving specific elements and adding or removing elements from the
collection.
Seems like that'd be a good place to start.
Pete
Hi Moondaddy,
What Pete has suggested is correct. The following is a sample code snippet
to remove the last segment from a PathFigure.
private void button1_Click(object sender, RoutedEventArgs e)
{
PathGeometry pg = this.path1.Data as PathGeometry;
// remove the last segment from the first PathFigure within the
PathFigureCollection of the PathGeometry
pg.Figures[0].Segments.RemoveAt(pg.Figures[0].Segments.Count -
1);
}
Hope this helps.
If you have any question, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Why do you use "as PathGeometry"? and not this:
PathGeometry pg = this.path1.Data;
Thanks again!
"Linda Liu[MSFT]" <v-l...@online.microsoft.com> wrote in message
news:AUzn9ZCr...@TK2MSFTNGHUB02.phx.gbl...
Willy.
"moondaddy" <moon...@newsgroup.nospam> wrote in message
news:%23gsqC3C...@TK2MSFTNGP04.phx.gbl...
Thanks for your prompt reply!
The Path.Data property is of type Geometry, which is an abstract base
class.
In our scenario, the type of the path1.Data property is actually
PathGeometry, which is derived from the type Geometry. So I use the "as"
operator in C# to convert this property to the type PathGeometry.
Hope this helps.
If you have anything unclear, please feel free to let me know.
Sincerely,
Linda Liu
Microsoft Online Community Support
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
msd...@microsoft.com.
This posting is provided "AS IS" with no warranties, and confers no rights.
I am reviewing this post in the newsgroup and would like to know the status
of this issue.
If you have any other question, please feel free to let me know.
Thank you for using our Managed Newsgroup Support Service!
"Linda Liu[MSFT]" <v-l...@online.microsoft.com> wrote in message
news:9bT9AO%23rIH...@TK2MSFTNGHUB02.phx.gbl...
Thank you for your response!
If you have any other questions in the future, please don't hesitate to
contact us. It's always our pleasure to be of assistance.
Have a nice day!