Skip to content

Commit

Permalink
Samples are revamped for symbol group view model implementation.
Browse files Browse the repository at this point in the history
  • Loading branch information
deepathiruppathy01 committed Jun 11, 2024
1 parent d965a59 commit db736ab
Show file tree
Hide file tree
Showing 17 changed files with 623 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@
</Setter.Value>
</Setter>
</Style>

<!--Style for Connector-->
<Style TargetType="syncfusion:Connector">
<Setter Property="ConnectorGeometryStyle">
<Setter.Value>
Expand All @@ -79,6 +81,7 @@
</Setter.Value>
</Setter>
</Style>

<!--Style for Symbol-->
<Style TargetType="stencil:Symbol">
<Setter Property="Width"
Expand Down Expand Up @@ -130,6 +133,10 @@
</Setter>
</Style>

<DataTemplate x:Key="TitleTemplate">
<TextBlock x:Name="HeaderText" Text="{Binding}" FontSize="15" FontWeight="SemiBold" Foreground="#2b579a" />
</DataTemplate>

</ResourceDictionary>
</Window.Resources>

Expand Down Expand Up @@ -158,7 +165,8 @@
ExpandMode="ZeroOrMore"
BorderBrush="#dfdfdf"
BorderThickness="1"
GroupMappingName="Key">
GroupMappingName="Key"
TitleTemplate="{StaticResource TitleTemplate}">
<stencil:Stencil.SymbolSource>
<syncfusion:SymbolCollection>
<!--Define the DiagramElement- Node-->
Expand Down Expand Up @@ -244,5 +252,6 @@
</syncfusion:SfDiagram>
</Grid>
</Window>




Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Syncfusion.Licensing, Version=25.2462.6.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
<HintPath>packages\Syncfusion.Licensing.25.2.6\lib\net462\Syncfusion.Licensing.dll</HintPath>
<Reference Include="Syncfusion.Licensing, Version=26.1462.35.0, Culture=neutral, PublicKeyToken=632609b4d040f6b4, processorArchitecture=MSIL">
<HintPath>packages\Syncfusion.Licensing.26.1.35\lib\net462\Syncfusion.Licensing.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.SfDiagram.WPF, Version=25.2462.6.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>packages\Syncfusion.SfDiagram.WPF.25.2.6\lib\net462\Syncfusion.SfDiagram.WPF.dll</HintPath>
<Reference Include="Syncfusion.SfDiagram.WPF, Version=26.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>packages\Syncfusion.SfDiagram.WPF.26.1.35\lib\net462\Syncfusion.SfDiagram.WPF.dll</HintPath>
</Reference>
<Reference Include="Syncfusion.Shared.WPF, Version=25.2462.6.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>packages\Syncfusion.Shared.WPF.25.2.6\lib\net462\Syncfusion.Shared.WPF.dll</HintPath>
<Reference Include="Syncfusion.Shared.WPF, Version=26.1462.35.0, Culture=neutral, PublicKeyToken=3d67ed1f87d44c89, processorArchitecture=MSIL">
<HintPath>packages\Syncfusion.Shared.WPF.26.1.35\lib\net462\Syncfusion.Shared.WPF.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Data" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Syncfusion.Licensing" version="25.2.6" targetFramework="net462" />
<package id="Syncfusion.SfDiagram.WPF" version="25.2.6" targetFramework="net462" />
<package id="Syncfusion.Shared.WPF" version="25.2.6" targetFramework="net462" />
<package id="Syncfusion.Licensing" version="26.1.35" targetFramework="net462" />
<package id="Syncfusion.SfDiagram.WPF" version="26.1.35" targetFramework="net462" />
<package id="Syncfusion.Shared.WPF" version="26.1.35" targetFramework="net462" />
</packages>
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SymbolGroupViewModel sample

This sample demonstrate how to create the symbol group view model to the stencil with symbols, name, category source properties.

__*Documentation*__: https://help.syncfusion.com/wpf/diagram/serialization
## Project pre-requisites
To run this application, you need to have the below two in your system

* [Visual Studio 2019](https://www.visualstudio.com/wpf-vs)
* [Syncfusion.SfDiagram.WPF](https://www.nuget.org/packages/Syncfusion.SfDiagram.WPF/) nuget package. To install the package using NuGet Package Manager, refer this [link](https://docs.microsoft.com/en-us/nuget/quickstart/install-and-use-a-package-in-visual-studio#nuget-package-manager).

## Deploying and running the sample
* To debug the sample and then run it, press F5 or select Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or selectDebug > Start Without Debugging.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.2" />
</startup>
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Application x:Class="SymbolGroupViewModelScenarios.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SymbolGroupViewModelScenarios"
StartupUri="MainWindow.xaml">
<Application.Resources>

</Application.Resources>
</Application>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace SymbolGroupViewModelScenarios
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<Window x:Class="SymbolGroupViewModelScenarios.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:SymbolGroupViewModelScenarios"
mc:Ignorable="d"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
Title="MainWindow" Height="450" Width="800">
<Window.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Syncfusion.SfDiagram.Wpf;component/Resources/BasicShapes.xaml"/>
</ResourceDictionary.MergedDictionaries>

<Style TargetType="syncfusion:Node">
<Setter Property="ShapeStyle">
<Setter.Value>
<Style TargetType="Path">
<Setter Property="Fill" Value="#FF5B9BD5"/>
<Setter Property="Stretch" Value="Fill"/>
<Setter Property="Stroke" Value="#FFEDF1F6"/>
</Style>
</Setter.Value>
</Setter>
</Style>

<!--Style for Symbol-->
<Style TargetType="syncfusion:Symbol">
<Setter Property="Width"
Value="50" />
<Setter Property="Height"
Value="50" />
<Setter Property="BorderThickness"
Value="1" />
<Setter Property="Background"
Value="Transparent" />
<Setter Property="BorderBrush"
Value="Transparent" />
</Style>

</ResourceDictionary>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="300"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<syncfusion:Stencil x:Name="stencil1"
Title="Shapes"
SymbolGroupDisplayMode="Accordion"
SymbolSelectionMode="Multiple"
DisplayMode="Expanded"
Grid.Column="0"
GroupMappingName="Key">
<syncfusion:Stencil.SymbolGroups>
<syncfusion:SymbolGroups>
<syncfusion:SymbolGroupViewModel Name="Basic Shapes" CategorySource="{StaticResource BasicShapes}">
<syncfusion:SymbolGroupViewModel.Symbols>
<syncfusion:SymbolCollection>
<syncfusion:NodeViewModel Name="Object"
UnitHeight="50"
UnitWidth="50"
Shape="{StaticResource Object}"/>
<syncfusion:NodeViewModel Name="User"
UnitHeight="50"
UnitWidth="50"
Shape="{StaticResource User}"/>
</syncfusion:SymbolCollection>
</syncfusion:SymbolGroupViewModel.Symbols>
</syncfusion:SymbolGroupViewModel>
</syncfusion:SymbolGroups>
</syncfusion:Stencil.SymbolGroups>
</syncfusion:Stencil>

<syncfusion:SfDiagram x:Name="diagram1" Grid.Column="1">
<syncfusion:SfDiagram.HorizontalRuler>
<syncfusion:Ruler/>
</syncfusion:SfDiagram.HorizontalRuler>
<syncfusion:SfDiagram.VerticalRuler>
<syncfusion:Ruler Orientation="Vertical"/>
</syncfusion:SfDiagram.VerticalRuler>
<syncfusion:SfDiagram.SnapSettings>
<syncfusion:SnapSettings SnapConstraints="All"/>
</syncfusion:SfDiagram.SnapSettings>
<syncfusion:SfDiagram.Nodes>
<syncfusion:NodeCollection>

</syncfusion:NodeCollection>
</syncfusion:SfDiagram.Nodes>
<syncfusion:SfDiagram.Connectors>
<syncfusion:ConnectorCollection>

</syncfusion:ConnectorCollection>
</syncfusion:SfDiagram.Connectors>
<syncfusion:SfDiagram.Groups>
<syncfusion:GroupCollection>

</syncfusion:GroupCollection>
</syncfusion:SfDiagram.Groups>

</syncfusion:SfDiagram>
</Grid>
</Window>


Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
using Syncfusion.UI.Xaml.Diagram;
using Syncfusion.UI.Xaml.Diagram.Stencil;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace SymbolGroupViewModelScenarios
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SymbolGroupViewModelScenarios")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SymbolGroupViewModelScenarios")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.

//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]


[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]


// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit db736ab

Please sign in to comment.