public DiagramVM() { PageSettings = new PageSettings() { PageBorderBrush = new SolidColorBrush(Colors.Transparent), PageBackground = new SolidColorBrush(Colors.White) }; ScrollSettings = new ScrollSettings() { ScrollLimit = ScrollLimit.Diagram }; Menu = null; DataSourceSettings = new DataSourceSettings() { ParentId = "ParentId", Id = "EmpId", DataSource = GetData() }; LayoutManager = new Syncfusion.UI.Xaml.Diagram.Layout.LayoutManager() { Layout = new DirectedTreeLayout() { Type = LayoutType.Hierarchical, Orientation = TreeOrientation.LeftToRight, } }; ItemDeletingCommand = new Command(OnItemDeleting); }
public void TestClone([Values(true, false)] bool recursive, [ValueSource(nameof(Patterns))] string pattern) { var id = DataSourceId.CreateNew(); var dataSources = new DataSourceSettings { new DataSource(@"A:\stuff") }; dataSources.FolderDataSourceRecursive = recursive; dataSources.SelectedItem = id; dataSources.FolderDataSourcePattern = pattern; var cloned = dataSources.Clone(); cloned.Should().NotBeNull(); cloned.Should().NotBeSameAs(dataSources); cloned.SelectedItem.Should().Be(id); cloned.FolderDataSourceRecursive.Should().Be(recursive); cloned.FolderDataSourcePattern.Should().Be(pattern); cloned.Count.Should().Be(1); cloned[0].Should().NotBeNull(); cloned[0].Should().NotBeSameAs(dataSources[0]); cloned[0].File.Should().Be(@"A:\stuff"); }
public void Configure_WithValidSettins_Updates_Generator() { // Arrange var oldSensorType = TestGenerator.Sensor.DataType; var oldSensorSerial = TestGenerator.Sensor.Serial; var oldGenerationTimeInterval = TestGenerator.GenerationTimeInterval; var settings = new DataSourceSettings { DataType = DataType.Acoustic.ToString(), SensorSerial = "0987654321", GenerationTimeIntervalSeconds = "10", AuthToken = "11111", HostAddress = "http://localhost:4000/records", }; // Act TestGenerator.Configure(settings); // Assert (TestGenerator.Sensor.DataType).ShouldNotBeNull(); (TestGenerator.Sensor.DataType).ShouldNotBe(oldSensorType); (TestGenerator.Sensor.Serial).ShouldNotBeNull(); (TestGenerator.Sensor.Serial).ShouldNotBe(oldSensorSerial); (TestGenerator.GenerationTimeInterval).ShouldNotBeNull(); (TestGenerator.GenerationTimeInterval).ShouldNotBe(oldGenerationTimeInterval); }
public void TestCtor4() { var settings = new DataSourceSettings { new DataSource { Id = DataSourceId.CreateNew() }, new DataSource { Id = DataSourceId.CreateNew(), DisplayName = "My custom name" } }; using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logSourceFactory, _scheduler, _filesystem, settings, _bookmarks.Object)) { var group1 = dataSources.Sources.First() as IMergedDataSource; group1.Should().NotBeNull(); group1.DisplayName.Should().Be("Merged Data Source", "because merged data sources which don't have a display name shall be assigned a default one"); var group2 = dataSources.Sources.Last() as IMergedDataSource; group2.Should().NotBeNull(); group2.DisplayName.Should().Be("My custom name", "because a custom name was supplied"); } }
public MultiParentViewModel() { //Initialize Diagram Properties Connectors = new ObservableCollection <ConnectorVM>(); Constraints = Constraints.Remove(GraphConstraints.PageEditing, GraphConstraints.PanRails); Menu = null; Tool = Tool.ZoomPan; DefaultConnectorType = ConnectorType.Orthogonal; // Initialize Command for sample changes Orientation_Command = new DelegateCommand(OnOrientation_Command); // Initialize DataSourceSettings for SfDiagram DataSourceSettings = new DataSourceSettings() { ParentId = "ReportingPerson", Id = "Name", DataSource = GetData(), }; // Initialize LayoutSettings for SfDiagram LayoutManager = new LayoutManager() { Layout = new DirectedTreeLayout() { Type = LayoutType.Hierarchical, Orientation = TreeOrientation.TopToBottom, AvoidSegmentOverlapping = true, HorizontalSpacing = 40, VerticalSpacing = 40, }, }; }
public static IServiceCollection LoadApplicationConfiguration(this IServiceCollection services, IConfiguration configuration, string configurationSectionName) { var dataSourceSettings = new DataSourceSettings(); configuration.GetSection(configurationSectionName).Bind(dataSourceSettings); switch (dataSourceSettings.DatabaseType) { //Mapping the Config data to fit Mongodb case SourceType.Mongodb: ConfigMongodbClassMapping.Mapping(); break; case SourceType.MsSql: break; default: throw new ArgumentOutOfRangeException(); } services.AddSingleton(sp => new AppLoadConfig(dataSourceSettings).AppConfigInstance); services.AddSingleton <IDataSourceSettings>(dataSourceSettings); return(services); }
public MainWindow() { InitializeComponent(); //To Represent LayoutManager diagramControl.LayoutManager = new Syncfusion.UI.Xaml.Diagram.Layout.LayoutManager() { Layout = new DirectedTreeLayout() }; //Initialize Employee class ObservableCollection <Employee> employee = new ObservableCollection <Employee>(); // Initialize DataSourceSettings DataSourceSettings settings = new DataSourceSettings(); //Get DataSourceSettings Properties. settings.ParentId = "ParentId"; settings.Id = "EmpId"; //Initialize Method Data(employee); settings.DataSource = employee; diagramControl.DataSourceSettings = settings; //Initialize PageSettings and Constraints InitializeDiagram(); //To Disable ContextMenu diagramControl.Menu = null; diagramControl.Tool = Tool.ZoomPan; }
public MultiParent() { //Initialize Diagram Properties Connectors = new ObservableCollection <ConnectorVM>(); Menu = null; Tool = Tool.MultipleSelect; HorizontalRuler = new Ruler { Orientation = Orientation.Horizontal }; VerticalRuler = new Ruler { Orientation = Orientation.Vertical }; DefaultConnectorType = ConnectorType.Orthogonal; // Initialize DataSourceSettings for SfDiagram DataSourceSettings = new DataSourceSettings() { ParentId = "ReportingPerson", Id = "Name", DataSource = GetData(), }; // Initialize LayoutSettings for SfDiagram LayoutManager = new LayoutManager() { Layout = new DirectedTreeLayout() { Type = LayoutType.Hierarchical, Orientation = TreeOrientation.TopToBottom, AvoidSegmentOverlapping = true, HorizontalSpacing = 40, VerticalSpacing = 40, }, }; }
/// <summary> /// Extension methos to add service for data generation. /// </summary> /// <param name="services">DI container.</param> /// <param name="configuration">Application configuration.</param> /// <param name="environment">Application environment.</param> /// <returns>Application services.</returns> public static IServiceCollection AddDataSourceService(this IServiceCollection services, IConfiguration configuration, IHostEnvironment environment) { var appSettingsSection = configuration.GetSection("AppSettings"); var appSettings = appSettingsSection.Get <AppSettings>(); var hostAddress = environment.IsProduction() ? appSettings.DockerHostAddress : appSettings.DefaultHostAddress; var settings = new DataSourceSettings { AuthToken = appSettings.AuthToken, HostAddress = hostAddress, DataType = appSettings.DataType, GenerationTimeIntervalSeconds = appSettings.GenerationTimeIntervalSeconds, SensorSerial = appSettings.SensorSerial, }; services.AddSingleton <IDataSourceService>(app => new DataSourceService(settings)); var provider = services.BuildServiceProvider(); var myDataSourceService = provider.GetService <IDataSourceService>(); return(services); }
public ExpandandCollapseViewModel() { // Initialize Diagram properties Constraints = Constraints.Remove(GraphConstraints.PageEditing, GraphConstraints.PanRails); Constraints = Constraints.Add(GraphConstraints.Commands); Menu = null; DefaultConnectorType = ConnectorType.Orthogonal; Tool = Tool.ZoomPan; //Initialize Commands ExpandCollapseCommand = new DelegateCommand(OnExpandCollaseCommand); // Initialize DataSourceSettings for SfDiagram DataSourceSettings = new DataSourceSettings() { ParentId = "ParentId", Id = "Id", DataSource = Getdata(), }; // Initialize LayoutSettings for SfDiagram LayoutManager = new LayoutManager() { Layout = new DirectedTreeLayout() { Type = LayoutType.Organization, }, }; ItemAddedCommand = new DelegateCommand(OnItemAdded); }
public override void LayoutSubviews() { base.LayoutSubviews(); parentView.Frame = new CGRect(0, 0, this.Frame.Width, this.Frame.Height); diagram.BeginNodeRender += Dia_BeginNodeRender; diagram.BeginNodeLayout += Dia_GetLayoutInfo; diagram.ItemLongPressed += Dia_ItemLongPressed; diagram.BackgroundColor = UIColor.White; diagram.EnableSelectors = false; diagram.NodeClicked += Dia_NodeClicked; diagram.Loaded += Dia_Loaded; //Initialize Method datamodel = new DataModel(); datamodel.Data(); //To Represent DataSourceSttings Properties DataSourceSettings settings = new DataSourceSettings(); settings.ParentId = "ReportingPerson"; settings.Id = "Name"; settings.DataSource = datamodel.employee; diagram.DataSourceSettings = settings; //To Represent LayoutManager Properties diagram.LayoutManager = new LayoutManager() { Layout = new DirectedTreeLayout() { Type = LayoutType.Organization, HorizontalSpacing = 35, } }; for (int i = 0; i < diagram.Connectors.Count; i++) { diagram.Connectors[i].TargetDecoratorType = DecoratorType.None; diagram.Connectors[i].Style.StrokeBrush = new SolidBrush(UIColor.FromRGB(127, 132, 133)); diagram.Connectors[i].Style.StrokeWidth = 1; } //Set width and height for diagram diagram.Width = (float)parentView.Frame.Width; diagram.Height = (float)parentView.Frame.Height; parentView.AddSubview(diagram); diagram.LayoutSubviews(); this.AddSubview(parentView); foreach (var view in this.Subviews) { verticalLabel.Frame = new CGRect(this.Frame.X + 10, 0, PopoverSize.Width - 20, 30); verticalbutton.Frame = new CGRect(this.Frame.X + 10, 40, PopoverSize.Width - 20, 30); horizontalbutton.Frame = new CGRect(this.Frame.X + 10, 80, PopoverSize.Width - 20, 30); selectionPicker1.Frame = new CGRect(0, PopoverSize.Height / 2, PopoverSize.Width, PopoverSize.Height / 3); doneButton.Frame = new CGRect(0, PopoverSize.Height / 2.5, PopoverSize.Width, 40); } }
public static IOptions <DataSourceSettings> BuildSettings() { var settings = new DataSourceSettings { DatabaseConnection = "Data Source=data.db;", FileLocation = "\\data.txt" }; return(Options.Create(settings)); }
public void TestMoveBefore2() { var dataSources = new DataSourceSettings(); var a = new DataSource(@"A"); var b = new DataSource(@"B"); dataSources.Add(a); dataSources.Add(b); dataSources.MoveBefore(a, b); dataSources.Should().Equal(a, b); }
public void TestMoveBefore5() { var dataSources = new DataSourceSettings(); var a = new DataSource(@"A"); var b = new DataSource(@"B"); var c = new DataSource(@"C"); dataSources.Add(a); new Action(() => dataSources.MoveBefore(b, c)).Should().NotThrow(); dataSources.Should().Equal(a); }
public void Configure_WithEmptySettins_Returns_ArgumentNullException() { // Arrange DataSourceSettings settings = null; // Act var configureGenerator = new Action(() => TestGenerator.Configure(settings)); // Assert Assert.Throws <ArgumentNullException>(configureGenerator); }
public void Constructor_WithEmptySettins_Returns_ArgumentNullException() { // Arrange DataSourceSettings settings = null; // Act var constructGenerator = new Action(() => new DataSourceService(settings)); // Assert Assert.Throws <ArgumentNullException>(constructGenerator); }
public void SetUp() { _settings = new DataSourceSettings(); _bookmarks = new Mock <IBookmarks>(); _scheduler = new ManualTaskScheduler(); _logSourceFactory = new SimplePluginLogSourceFactory(_scheduler); _filesystem = new InMemoryFilesystem(); _dataSources = new DataSources(_logSourceFactory, _scheduler, _filesystem, _settings, _bookmarks.Object); _actionCenter = new Mock <IActionCenter>(); _applicationSettings = new Mock <IApplicationSettings>(); }
public void TestAddGroup1() { var settings = new DataSourceSettings(); using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logSourceFactory, _scheduler, _filesystem, settings, _bookmarks.Object)) { MergedDataSource group = dataSources.AddGroup(); group.Should().NotBeNull(); group.Settings.Should().NotBeNull(); settings.Should().Equal(group.Settings); } }
public void TestCtor3() { var settings = new DataSourceSettings { new DataSource("test1.log") { Id = DataSourceId.CreateNew() }, new DataSource("test2.log") { Id = DataSourceId.CreateNew() }, new DataSource("test.log") { Id = DataSourceId.CreateNew() } }; var merged1 = new DataSource { Id = DataSourceId.CreateNew() }; settings.Add(merged1); var merged2 = new DataSource { Id = DataSourceId.CreateNew() }; settings.Add(merged2); var merged3 = new DataSource { Id = DataSourceId.CreateNew() }; settings.Add(merged3); settings[0].ParentId = merged1.Id; settings[1].ParentId = merged2.Id; settings[2].ParentId = merged3.Id; using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logSourceFactory, _scheduler, _filesystem, settings, _bookmarks.Object)) { dataSources.Count.Should().Be(6, "Because we've loaded 6 data sources"); var mergedDataSource1 = dataSources[3] as MergedDataSource; mergedDataSource1.Should().NotBeNull(); mergedDataSource1.OriginalSources.Should().Equal(new object[] { dataSources[0] }); var mergedDataSource2 = dataSources[4] as MergedDataSource; mergedDataSource2.Should().NotBeNull(); mergedDataSource2.OriginalSources.Should().Equal(new object[] { dataSources[1] }); var mergedDataSource3 = dataSources[5] as MergedDataSource; mergedDataSource3.Should().NotBeNull(); mergedDataSource3.OriginalSources.Should().Equal(new object[] { dataSources[2] }); } }
internal GenericDbDataSource(string name, string connectionString, DataSourceSettings settings = null) : base(settings) { if (string.IsNullOrEmpty(connectionString)) { throw new ArgumentException("connectionString is null or empty.", "connectionString"); } m_ConnectionBuilder = new DbConnectionStringBuilder(); m_ConnectionBuilder.ConnectionString = connectionString; Name = name; m_ExtensionCache = new ConcurrentDictionary <Type, object>(); m_Cache = DefaultCache; }
public DataSourceServiceTest() { var settings = new DataSourceSettings { DataType = DataType.Temperature.ToString(), SensorSerial = "123456789", GenerationTimeIntervalSeconds = "5", AuthToken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImE3NWI2OWI4LTk2OWYtNDY5ZS1iMjZkLTA4ZDgxMzg5NGQyNyIsInJvbGUiOiJBZG1pbiIsIm5iZiI6MTU5MjU3MDMwMCwiZXhwIjoxNTkzMTc1MTAwLCJpYXQiOjE1OTI1NzAzMDB9.OBHTe43zxDN5o7pnwNEauyZ73m_juw7z46XW8C8nNvU", HostAddress = "http://localhost:3000/records", }; TestGenerator = new DataSourceService(settings); }
public void TestRoundtrip([Values(true, false)] bool recursive, [ValueSource(nameof(Patterns))] string pattern) { var settings = new DataSourceSettings { FolderDataSourceRecursive = recursive, FolderDataSourcePattern = pattern }; var actual = Roundtrip(settings); actual.FolderDataSourceRecursive.Should().Be(recursive); actual.FolderDataSourcePattern.Should().Be(pattern); }
public void OnNavigatedTo(NavigationContext navigationContext) { if (navigationContext is null) { throw new ArgumentNullException(nameof(navigationContext)); } courses = navigationContext.Parameters["courses"] as IEnumerable <ExcelBasedCourse>; // Initialize DataSourceSettings for SfDiagram var dataItems = GetData(courses); DataSourceSettings = new DataSourceSettings() { ParentId = "ReportingPerson", Id = "Name", DataSource = dataItems, }; var groups = new ObservableCollection <GroupViewModel>(); foreach (var group in from c in dataItems orderby c.Course.Semester group c by c.Course.Semester into g select new { Semester = g.Key, DataItems = g }) { //groups.Add(new GroupViewModel //{ // Nodes = group.DataItems.ToArray(), // ID=group.Semester, // Key=group.Semester, // ZIndex=1 //}); } //Groups = groups; // Initialize LayoutSettings for SfDiagram LayoutManager = new LayoutManager() { Layout = new DirectedTreeLayout() { Type = LayoutType.Hierarchical, Orientation = TreeOrientation.LeftToRight, AvoidSegmentOverlapping = true, HorizontalSpacing = 40, VerticalSpacing = 40, }, }; }
private void UpdateDataSourceSettings() { // Load the data source settings into the report var security = new PortalSecurity(); Report.Title = txtTitle.Text; Report.Description = security.InputFilter(txtDescription.Text, PortalSecurity.FilterFlag.NoScripting); Report.Parameters = txtParameters.Text; Report.CreatedBy = UserId; Report.CreatedOn = DateTime.Now; Report.DataSource = DataSourceDropDown.SelectedValue; // Get the active data source settings control var activeDataSource = GetSettingsControlFromView(DataSourceSettings.GetActiveView()) as IDataSourceSettingsControl; // If there is an active data source, save its settings if (activeDataSource != null) { Report.DataSourceClass = activeDataSource.DataSourceClass; activeDataSource.SaveSettings(Report.DataSourceSettings); } // Update Converter settings Report.Converters.Clear(); if (!string.IsNullOrEmpty(txtHtmlDecode.Text.Trim())) { foreach (var field in txtHtmlDecode.Text.Split(',')) { var newConverter = new ConverterInstanceInfo(); newConverter.FieldName = Convert.ToString(field); newConverter.ConverterName = "HtmlDecode"; newConverter.Arguments = null; ConverterUtils.AddConverter(Report.Converters, newConverter); } } if (!string.IsNullOrEmpty(txtHtmlEncode.Text.Trim())) { foreach (var field in txtHtmlEncode.Text.Split(',')) { var newConverter = new ConverterInstanceInfo(); newConverter.FieldName = Convert.ToString(field); newConverter.ConverterName = "HtmlEncode"; newConverter.Arguments = null; ConverterUtils.AddConverter(Report.Converters, newConverter); } } }
public OrganizationChart() { this.InitializeComponent(); //Initialize Nodes and Connectors sfdiagram.Nodes = new DiagramCollection <NodeViewModel>(); sfdiagram.Connectors = new DiagramCollection <ConnectorViewModel>(); //Item Added Event (sfdiagram.Info as IGraphInfo).ItemAdded += MainWindow_ItemAdded; (sfdiagram.Info as IGraphInfo).GetLayoutInfo += MainWindow_GetLayoutInfo; //Initialize PageSettings InitializeDiagram(); employee = new ObservableCollection <Employee>(); //Get Path imagepath = "ms-appx:///Assets"; //Initialize Method Data(); //To Enable Zooming and Panning sfdiagram.Tool = Tool.ZoomPan; sfdiagram.Constraints = sfdiagram.Constraints & ~GraphConstraints.PanRails; //To Represent DataSourceSttings Properties DataSourceSettings settings = new DataSourceSettings(); settings.ParentId = "ReportingPerson"; settings.Id = "Name"; settings.DataSource = employee; sfdiagram.DataSourceSettings = settings; //To Represent LayoutManager Properties sfdiagram.LayoutManager = new Syncfusion.UI.Xaml.Diagram.Layout.LayoutManager() { Layout = new DirectedTreeLayout() { Type = Syncfusion.UI.Xaml.Diagram.Layout.LayoutType.Organization, HorizontalSpacing = 50, VerticalSpacing = 40 } }; this.Loaded += sfdiagram_Loaded; }
public MainWindow() { this.InitializeComponent(); //Initialize Nodes and Connectors this.sfdiagram.Nodes = new DiagramCollection <NodeViewModel>(); this.sfdiagram.Connectors = new DiagramCollection <CustomConnectorViewModel>(); this.sfdiagram.HorizontalRuler = new Ruler { Orientation = Orientation.Horizontal }; this.sfdiagram.VerticalRuler = new Ruler { Orientation = Orientation.Vertical }; layoutSettings = new DirectedTreeLayout { Type = LayoutType.Hierarchical, Orientation = TreeOrientation.TopToBottom, HorizontalSpacing = 40, VerticalSpacing = 40, Margin = new Thickness(), AvoidSegmentOverlapping = true, }; //To Represent LayoutManager Properties this.sfdiagram.LayoutManager = new LayoutManager { Layout = layoutSettings }; //PageSettings used to enable the Appearance of Digram Page. this.sfdiagram.PageSettings.PageBorderBrush = new SolidColorBrush(Colors.Transparent); var data = new ObservableCollection <ItemInfo>(); //Initialize Method this.GetDataSource(data); //Initialize DataSourceSettings and Represent ParentId,Id. var settings = new DataSourceSettings(); settings.ParentId = "ReportingPerson"; settings.Id = "Name"; settings.DataSource = data; this.sfdiagram.DataSourceSettings = settings; this.Loaded += MainWindow_Loaded; this.sfdiagram.Tool = Tool.ZoomPan; }
public RadialTree() { this.InitializeComponent(); //To Disable ContextMenu diagramControl.Menu = null; //Initialize Nodes and Connectors diagramControl.Nodes = new ObservableCollection <Node>(); diagramControl.Connectors = new ObservableCollection <Connector>(); //Item Added Event (diagramControl.Info as IGraphInfo).ItemAdded += MainWindow_ItemAdded; employee = new ObservableCollection <Employee1>(); //To Represent DataSourceSettings Properties DataSourceSettings settings = new DataSourceSettings(); settings.ParentId = "ParentId"; settings.Id = "EmpId"; settings.Root = "1"; settings.DataSource = employee; diagramControl.DataSourceSettings = settings; imagepath = "ms-appx:///Assets/"; //Initialize method Data(); diagramControl.Tool = Tool.ZoomPan; diagramControl.Constraints = diagramControl.Constraints & ~GraphConstraints.PanRails; //Constraints used to enable/disable the Selection //To Represent LayoutManager Properties diagramControl.LayoutManager = new LayoutManager() { Layout = new RadialTreeLayout() }; (diagramControl.LayoutManager.Layout as RadialTreeLayout).HorizontalSpacing = 10; (diagramControl.LayoutManager.Layout as RadialTreeLayout).VerticalSpacing = 35; //Initialize PageSettings and Constraints InitializeDiagram(); //Unload Diagram this.Unloaded += diagramControl_Unloaded; }
public void TestCtor5() { var settings = new DataSourceSettings { new DataSource { Id = DataSourceId.CreateNew(), LogFileFolderPath = @"F:\logs" }, }; using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logSourceFactory, _scheduler, _filesystem, settings, _bookmarks.Object)) { var folder = dataSources.Sources.First() as IFolderDataSource; folder.Should().NotBeNull(); } }
public void TestCtor1() { var settings = new DataSourceSettings { new DataSource(@"E:\Code\test.log") { Id = DataSourceId.CreateNew() } }; using (var dataSources = new Tailviewer.BusinessLogic.DataSources.DataSources(_logSourceFactory, _scheduler, _filesystem, settings, _bookmarks.Object)) { dataSources.Count.Should().Be(1); IDataSource dataSource = dataSources.Sources.First(); dataSource.FullFileName.Should().Be(settings[0].File); dataSource.Id.Should().Be(settings[0].Id); } }
public MainWindow() { InitializeComponent(); //Initialize Nodes and Connectors sfdiagram.Nodes = new DiagramCollection <NodeViewModel>(); sfdiagram.Connectors = new DiagramCollection <ConnectorViewModel>(); //To Represent LayoutManager Properties sfdiagram.LayoutManager = new Syncfusion.UI.Xaml.Diagram.Layout.LayoutManager() { Layout = new DirectedTreeLayout() { Type = Syncfusion.UI.Xaml.Diagram.Layout.LayoutType.Organization, HorizontalSpacing = 50, VerticalSpacing = 40 } }; //Item Added Event (sfdiagram.Info as IGraphInfo).GetLayoutInfo += MainWindow_GetLayoutInfo; //PageSettings used to enable the Appearance of Digram Page. sfdiagram.PageSettings.PageBorderBrush = new SolidColorBrush(Colors.Transparent); ObservableCollection <Employee> employee = new ObservableCollection <Employee>(); //Initialize Method Data(employee); //Initialize DataSourceSettings and Represent ParentId,Id. DataSourceSettings settings = new DataSourceSettings(); settings.ParentId = "ReportingPerson"; settings.Id = "Name"; settings.DataSource = employee; sfdiagram.DataSourceSettings = settings; this.Loaded += MainPage_Loaded; sfdiagram.Tool = Tool.ZoomPan; sfdiagram.Constraints &= ~(GraphConstraints.PageEditing | GraphConstraints.PanRails); }