Quest: WPF - Troble with Canvas.SetLeft() & Canvas.SetTop()...

B

Brandon

Hello,

I am working on a project that as the following...
1) main WPF Window obj in MyWindow.xaml -
The window just now contains 2) more later...
2) and I have a canvas obj in Canvas.xaml...
The canvas just now contains 3) more later...
3) a custom UserControl obj in MyControl.xaml...
The UserControl contains a StackPanel element and which
contains several controls...

Now I am having problems using Canvas.SetLeft() & Canvas.SetTop() in
MyControl.cs to change the the position of the UserControl obj on the
canvas because Canvas.SetLeft() & Canvas.SetTop() isn't getting pumped
to the canvas obj as it would if 2) and 3) were both just written into
Canvas.xaml... With 1), 2), and 3) in play I can set the UserControl obj
initial position on the canvas in 2) when in Canvas.xaml adds the
UserControl obj to the Canvas but I can't yet move the UserControl obj
like if I want to handle an event in MyControl.cs and move the
UserControl obj...

Anyway to change the position of 3) on 2) when using separate .xaml files?

Any help...

Brandon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top