This is a migrated thread and some comments may be shown as answers.

Popup size on diagram

7 Answers 180 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
Wenrong
Top achievements
Rank 1
Wenrong asked on 27 Jun 2012, 07:44 AM
Currently the zoom behaviour of the popup on a diagram is determined by the zoom level of the diagram when the popup is opened. Any subsequent zooming action would not change the appearance of the popup. This can be observed in the MindMap sample.

Is it possible to change this behaviour so that the popup is always displayed without zoom render transform? just like when using the ItemInformationAdorner.AdditionalContent?

7 Answers, 1 is accepted

Sort by
0
Miro Miroslavov
Telerik team
answered on 27 Jun 2012, 10:04 AM
Hello Wenrong,

 The Popup within the MindMap example is placed inside the Shape's ControlTemplate and so it is part of the zoom-able visual tree. This is just for the sample, but I would recommend you to do it using the Selection adorner or to modify the Settings Pane control to suits your need. (Actually the Settings Pane is usually added to the ItemInformationAdorner.AdditionalContent. For the next release of the samples we'll also improve this behaviour.
Please let us know if you have further questions. 

Greetings,
Miro Miroslavov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Wenrong
Top achievements
Rank 1
answered on 27 Jun 2012, 08:37 PM
Hmm... do you have any example of using a selection adorner? My popup control is only specific to each item (rather than to a group of items), that's why I chose to follow the MindMap example in the first place as the ItemInformationAdorner.AdditionalContent seem to be applied to the current selection, be it a single shape or a group of shapes...
0
Wenrong
Top achievements
Rank 1
answered on 28 Jun 2012, 08:14 AM
Thinking about it, it would work if I can make the ItemInformationAdorner only appear when there is only one item selected.

Is that possible?
0
Accepted
Miro Miroslavov
Telerik team
answered on 29 Jun 2012, 12:51 PM
Hello Wenrong,

 The ItemInformationAdorner is placed on the same size as the Selection Adorner, meaning that currently the only way to make it appears on one item is to use Single selection instead of multiple. 
So if this is not an option, we have only two options right now - to reverse scale/zoom it (if you go the Mindmap way), which could be somehow hard to do. Or the other option is to change the diagram template and there is a way to add there a new adorner that you can later place only on single shapes. Actually you can do that outside the Diagram - you can handle the Selection event and place a popup (or floating canvas) next to the selected shape. You can easily get the actual position of the Shape and just place your adorning thing there.
In the meanwhile, I'll add a work item so that we must provide an API for easier way of doing this.
Please let us know if any of these solutions work for you, or you need further assistance. 

Greetings,
Miro Miroslavov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Wenrong
Top achievements
Rank 1
answered on 30 Jun 2012, 05:45 AM
Yup, the last option worked for me. Thanks.
0
Aakansha
Top achievements
Rank 1
answered on 27 Nov 2014, 10:58 AM
Hi Miro...can you give me sample project to understand how can I control Popup size on diagram without getting it effected by the diagram size of mind map. I am not able to understand from the above answers.
0
Zarko
Telerik team
answered on 01 Dec 2014, 03:30 PM
Hi Aakansha,
One way to achieve this is to change the DropDown button in the MindMap shape's styles with a toggle button:
<telerik:RadGeometryToggleButton x:Name="settingsPaneButton"
        IsChecked="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=IsSettingsOpen, Mode=TwoWay}"
        Style="{StaticResource SettingsPaneToggle}" />
Then handle this toggle button's Checked and Unchecked events and open/close a separate popup (which is not part of the RadDiagram) containing the SettingsPane:
 
this.AddHandler(RadGeometryToggleButton.CheckedEvent, new RoutedEventHandler(OnChecked));
this.AddHandler(RadGeometryToggleButton.UncheckedEvent, new RoutedEventHandler(OnUnchecked));
 
private void OnUnchecked(object sender, RoutedEventArgs e)
{
    var button = e.OriginalSource as RadGeometryToggleButton;
    if (button != null && button.Name == "settingsPaneButton")
    {
       ...
    }
}
 
private void OnChecked(object sender, RoutedEventArgs e)
{
    var button = e.OriginalSource as RadGeometryToggleButton;
    if (button != null && button.Name == "settingsPaneButton")
    {
        ...
    }
}
You'll also have to handle a couple of diagram events to close the Popup - PreviewZoom, PreviewDrag and etc.
I've attached a sample project demonstrating this approach for the MindMap's Root and FirstLevel shapes so could you please examine it and tell us if this is what you're looking for. 


Regards,
Zarko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Diagram
Asked by
Wenrong
Top achievements
Rank 1
Answers by
Miro Miroslavov
Telerik team
Wenrong
Top achievements
Rank 1
Aakansha
Top achievements
Rank 1
Zarko
Telerik team
Share this question
or