Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Create Customized sized canvas layout (Read 2526 times)
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Create Customized sized canvas layout
Apr 20th, 2017 at 5:57am
Print Post  
Hi,

I have a requirement to Customized sized canvas layout using dashboard tool bar,

if I explain this further

1. Initially load the Main Window
2 .Once click a button I can provide Height and Width of the canvas
3. Then that canvas generate inside main window


Thanks
Kelum
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3156
Joined: Oct 19th, 2005
Re: Create Customized sized canvas layout
Reply #1 - Apr 20th, 2017 at 7:50am
Print Post  
Hi,

Set diagram.Bounds = new Rect(0, 0, width, height) after you have the width and height.

Regards,
Slavcho
  
Back to top
 
IP Logged
 
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Re: Create Customized sized canvas layout
Reply #2 - Apr 20th, 2017 at 12:04pm
Print Post  
I have following user control, this is where mind-fusion canvas included

Code
Select All
    public partial class LayoutWindow : UserControl
    {

    } 


     
     inside this user control I have a button to open an another window call `PopUp`.

So I'm trying to update `LayoutWindow` UserControl `diagram.Bounds` property(which is canvas size), once above `OkButton_Click` click inside `PopUp` Window
     
Code
Select All
public partial class PopUp : Window
         {
	    private void OkButton_Click(object sender, RoutedEventArgs e)
            {

              LayoutWindow lw= new LayoutWindow();
              lw.InitializeComponent();
              lw.diagram.Bounds = new Rect(0, 0, 400, 400);
              Close();
            }

	} 


     
     but in this way it's not updating the canvas, how can I do this properly
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3156
Joined: Oct 19th, 2005
Re: Create Customized sized canvas layout
Reply #3 - Apr 20th, 2017 at 12:21pm
Print Post  
This code shows you assigning fixed 400x400 size to the diagram, and not one entered by users.
  
Back to top
 
IP Logged
 
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Re: Create Customized sized canvas layout
Reply #4 - Apr 20th, 2017 at 2:18pm
Print Post  
Nope, actually 'Popup' window contains that height width, I'm getting that values and bind here, for the simplicity I explain that way.
  
Back to top
 
IP Logged
 
kelum
Full Member
***
Offline


I Love MindFusion!

Posts: 100
Joined: Mar 25th, 2017
Re: Create Customized sized canvas layout
Reply #5 - Apr 21st, 2017 at 3:17am
Print Post  
thanks I sorted out it my self
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint