Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic DiagramPage not shown, not available (Read 1520 times)
RunMan
YaBB Newbies
*
Offline


I Love MindFusion!

Posts: 7
Joined: Sep 24th, 2015
DiagramPage not shown, not available
Nov 4th, 2015 at 9:20am
Print Post  
Hello,

i create simple application to pretest the DiagramDocument with several DiagramPages functionality.

See my xaml code below. But when i start the program, nothing can be seen. I expect to be able to draw simple nodes.


Code
Select All
<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:diag="http://mindfusion.eu/diagramming/wpf"
        xmlns:nodes="clr-namespace:TestMindfusion.Nodes"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d" x:Class="TestMindfusion.MainWindow"
        Title="MainWindow" Height="630" Width="892">
    <Grid>
        <diag:DiagramDocument x:Name="diagramDoc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
            <diag:DiagramPage Name="diagPage" Bounds="0, 0, 2000, 2000">
            </diag:DiagramPage>
        </diag:DiagramDocument>
    </Grid>
</Window>
 



Please give me a hint! Is there any example with DiagramDocument/DiagramPage. I've seen the TabbedDiagramView Example. But i need no tabbing. Just different pages.

Thank you
RunMan
  
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: DiagramPage not shown, not available
Reply #1 - Nov 4th, 2015 at 10:25am
Print Post  
Hi,

We consider DiagramDocument a data-container type and it does not come out of the box with a ControlTemplate for visualization. You can still set its template to show the pages, e.g. using a ListBox:

Code
Select All
<Window x:Class="ShowDoc.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:diag="http://mindfusion.eu/diagramming/wpf"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        mc:Ignorable="d"
        Title="MainWindow" Height="630" Width="892">
	<Grid>
		<diag:DiagramDocument x:Name="diagramDoc" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
			<diag:DiagramPage Name="diagPage1" Title="page 1" Bounds="0, 0, 800, 1000">
			</diag:DiagramPage>
			<diag:DiagramPage Name="diagPage2" Title="page 2" Bounds="0, 0, 800, 1000">
			</diag:DiagramPage>

			<diag:DiagramDocument.Template>
				<ControlTemplate TargetType="diag:DiagramDocument">
					<ListBox
						ScrollViewer.CanContentScroll="False"
						ItemsSource="{Binding Pages, RelativeSource={RelativeSource TemplatedParent}}">
						<ListBox.ItemTemplate>
							<DataTemplate>
								<HeaderedContentControl
									Header="{Binding Title}"
									Content="{Binding}"/>
							</DataTemplate>
						</ListBox.ItemTemplate>
					</ListBox>
				</ControlTemplate>
			</diag:DiagramDocument.Template>
		</diag:DiagramDocument>
	</Grid>
</Window> 



Alternatively, you could create a separate PagedDiagramView kind of control that binds a ListBox to document's pages and use it in the UI instead of the DiagramDocument.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint