=============== LIBRARY RULES =============== From library maintainers: - Use repository to get information on how to use Infragistics WPF components. ### Complete XamDataGrid and XamCalculationManager Setup Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamcalculationmanager-using-xamcalculationmanager-with-xamdatagrid.adoc This comprehensive XAML example sets up XamCalculationManager, XamFormulaEditor, and XamDataGrid with data binding, field layouts, and calculation settings. ```xaml ``` -------------------------------- ### Get Customers C# Example Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-customer-data.adoc Retrieves a collection of customer objects. Demonstrates using object initializers for efficient data population. ```csharp using System.ComponentModel; namespace IGDocumentation { public static class CustomerData { public static ObservableCollection GetCustomers() { ObservableCollection list = new ObservableCollection(); //Add Customers to the ObservableCollection using Object Initializers. list.Add(new Customer { ID = 123, FullName = new Name { FirstName = "John", LastName = "Smith" } }); list.Add(new Customer { ID = 456, FullName = new Name { FirstName = "John", LastName = "Smith" } }); list.Add(new Customer { ID = 789, FullName = new Name { FirstName = "Mary", LastName = "Smith" } }); //You can still use the old way of creating objects, setting properties, and then adding them to the collection as shown in the commented code below. //Customer customer; //Name name; //customer = new Customer(); //customer.ID = 123; //name = new Name(); //name.FirstName = "John"; //name.LastName = "Smith"; //customer.FullName = name; //list.Add(customer); //customer = new Customer(); //customer.ID = 456; //name = new Name(); //name.FirstName = "Mike"; //name.LastName = "Smith"; //customer.FullName = name; //list.Add(customer); //customer = new Customer(); //customer.ID = 789; //name = new Name(); //name.FirstName = "Mary"; //name.LastName = "Smith"; //customer.FullName = name; //list.Add(customer); return list; } } public class Customer:INotifyPropertyChanged { private int _id; public int ID { get { return _id; } set { if (_id != value) { _id = value; OnPropertyChanged("ID"); } } } private Name _fullName; public Name FullName { get { return _fullName; } set { if (_fullName != value) { _fullName = value; OnPropertyChanged("FullName"); } } } #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion private void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } public class Name:INotifyPropertyChanged { private string _firstName; public string FirstName { get { return _firstName; } set { _firstName = value; OnPropertyChanged("FirstName"); } } private string _lastName; public string LastName { get { return _lastName; } set { _lastName = value; OnPropertyChanged("LastName"); } } #region Overrides public static bool operator ==(Name a, Name b) { if (object.ReferenceEquals(a, null) && object.ReferenceEquals(b, null)) { return true; } else if (object.ReferenceEquals(a, null) || object.ReferenceEquals(b, null)) { return false; } return a.FirstName == b.FirstName && a.LastName == b.LastName; } public static bool operator !=(Name a, Name b) { return !(a == b); } public override bool Equals(object obj) { Name b = obj as Name; return this == b; } public override int GetHashCode() { return (this.FirstName + " " + this.LastName).GetHashCode(); } #endregion #region INotifyPropertyChanged Members public event PropertyChangedEventHandler PropertyChanged; #endregion private void OnPropertyChanged(string propertyName) { if (PropertyChanged != null) PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } ``` -------------------------------- ### Complete Document Setup with Header, Footer, and Page Numbers in C# Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/word-headers-footers-and-page-numbers.adoc This example demonstrates creating a Word document, setting units, creating a font, and adding headers, footers, and ordinal page numbers to the footer. Ensure the Infragistics.Documents.Word assembly is referenced. ```csharp using Infragistics.Documents.Word; // Create a new instance of the WordDocumentWriter class using the // static 'Create' method. // This instance must be closed once content is written into Word. WordDocumentWriter docWriter = WordDocumentWriter.Create(@"C:\TestWordDoc.docx"); // Use inches as the unit of measure docWriter.Unit = UnitOfMeasurement.Inch; // Create a font, which we can use in content creation Infragistics.Documents.Word.Font font = docWriter.CreateFont(); font.Bold = true; // Paragraph Properties ParagraphProperties paraformat = docWriter.CreateParagraphProperties(); //Start the document...note that each call to StartDocument must ``` -------------------------------- ### Visual Basic WcfListConnectorServiceSingle Example Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamschedule-using-connector-wcf.adoc This example demonstrates setting up item sources for appointments, resources, and resource calendars within a WcfListConnectorServiceSingle class. It initializes collections and a Resource object. ```vb Imports System.ComponentModel Imports Infragistics.Services.Schedules Imports Infragistics.Controls.Schedules.Services Public Class MyScheduleDataService Inherits WcfListConnectorServiceSingle Private appointments As BindingList(Of Appointment) Private resources As BindingList(Of Resource) Private resourceCalendars As BindingList(Of ResourceCalendar) Public Sub New() Me.resources = New BindingList(Of Resource)() Dim resource As New Resource() ``` -------------------------------- ### Full Code Example (Visual Basic) Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamtreemap-adding-xamtreemap-using-procedural.adoc This is a complete Visual Basic code example demonstrating how to procedurally add and configure the xamTreemap control within a Loaded event handler. ```vb Private Sub UserControl_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs) Dim data As New ManufacturerViewModel() Dim Treemap As New XamTreemap() Treemap.DataContext = data Treemap.ItemsSource = data.Manufacturers Me.LayoutRoot.Children.Add(Treemap) Dim binder As New NodeBinder() binder.TargetTypeName = "Manufacturer" binder.ValuePath = "Revenue" binder.TextPath = "Name" Treemap.NodeBinders.Add(binder) Dim mapper As New ColorMapper() mapper.ValueTypeName = "Manufacturer" mapper.TargetProperty = "Fill" mapper.ValuePath = "Revenue" ``` -------------------------------- ### Full Operator Precedence Rules Example Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/ig-spe-writing-operator-precedence-rules.adoc An example demonstrating how to define rules for multiple operators with varying precedence and associativity, including assignment, addition, subtraction, multiplication, and division. ```syntax AssignmentExpression = Identifier, Equals, Expression ; (* The main expression symbol uses only the lowest precedence symbol * ) Expression = AddSubtractExpression; (* Precedecene Level 6 * ) AddSubtractExpression = MultiplyDivideExpression | AddExpression | SubtractExpression; AddExpression = AddSubtractExpression, PlusToken, MultiplyDivideExpression; SubtractExpression = ``` -------------------------------- ### XAML Setup for XamGantt Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamgantt-code-example-creating-customized-view-for-xamgantt.adoc This XAML snippet shows the setup of the XamGantt control and its associated ListBackedProjectViewProvider within a Grid. ```xaml ``` -------------------------------- ### Full XAML Example: Runtime Gears Animation Brush Customization Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xambusyindicator-configuring-animations-brushes.adoc This comprehensive XAML example sets up a XamBusyIndicator with Gears animation and two XamColorPicker controls to dynamically change the BigGearFill and SmallGearFill brushes at runtime. It includes necessary resources like a value converter. ```xaml ``` -------------------------------- ### Complete Application Menu 2010 Example Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamribbon-defininganapplicationmenu2010.adoc Provides the complete XAML code for an Application Menu 2010, including one button and two tabs. This example shows the integration of various menu elements. ```xaml ``` -------------------------------- ### Complete Code Example for Application Menu 2010 Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamribbon-defininganapplicationmenu2010.adoc This example demonstrates the complete XAML structure for defining a xamRibbon with an Application Menu 2010, including buttons, separators, and tabs. It also shows how to set IsConstrainingElement for the backstage. ```XAML ``` -------------------------------- ### Non-Derivable Start Symbol Example Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/ig-spe-restrictions.adoc This grammar defines a start symbol that cannot be fully derived into terminal symbols, leading to an infinite derivation sequence and an invalid grammar. ```text StartSymbol → GroupedContent ``` ```text GroupedContent → (Parens | Brackets) ``` -------------------------------- ### Add xamMenu Control Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xammenu-navigating-pages-using-xammenu.adoc Define the xamMenu control in your XAML. This example shows a basic setup with a 'Pages' menu item. ```XAML ``` -------------------------------- ### Instantiating Custom Project Views Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamgantt-code-example-creating-view-for-xamgantt-using-custom-classes.adoc Demonstrates how to create and configure instances of the CustomProjectView class, setting various properties for different views. ```vb Public Function CreateProjectViews() As IEnumerable(Of CustomProjectView) Return New List(Of CustomProjectView)() From { New CustomProjectView() With { Key .Key = "View01", Key .TableKey = "Table01", Key .AreCriticalTasksHighlighted = False, Key .AreSummaryTasksVisible = True }, New CustomProjectView() With { Key .Key = "View02", Key .TableKey = "Table02", Key .AreCriticalTasksHighlighted = False, Key .AreSummaryTasksVisible = False }, New CustomProjectView() With { Key .Key = "View03", Key .TableKey = "Table03", Key .AreCriticalTasksHighlighted = True } } End Function ``` -------------------------------- ### Get Customer Data from Northwind Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-sampledatautil.adoc Retrieves all customer data from the Northwind database. Assumes the Northwind sample database is installed. ```csharp using (SqlConnection conn = new SqlConnection(connectionString)) { SqlCommand customerSelectCommand = new SqlCommand("SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers", conn); SqlDataAdapter customerAdapter = new SqlDataAdapter(customerSelectCommand); try { customerAdapter.Fill(customerDataSet, "Customers"); } catch (Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } } return customerDataSet; } ``` -------------------------------- ### Full Code Behind Example (C#) Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamtimeline-binding-to-data-with-xamtimeline.adoc Initializes the xamTimeline with a custom data collection, populates it, and configures the series with data binding. ```csharp using System.Windows.Controls; using System.Collections.ObjectModel; using Infragistics.Controls.Timelines; namespace Application1 { public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); var collection = new ObservableCollection(); for (int i = 1; i < 10; i++) { var dataEntry = new TimelineData() { Time = i * 100, Duration = 10, Title = "Data Title " + i, Details = "Data Description " + i }; collection.Add(dataEntry); } var series = new NumericTimeSeries(); series.Title = "Series With Data Binding"; series.DataSource = collection; series.DataMapping = "Time=Time;Duration=Duration;Title=Title;Details=Details"; this.xamTimeline.Series.Add(series); } } public class TimelineData { public TimelineData() { } public TimelineData(int newTime, int newDuration, string newTitle, string newDetails) { Time = newTime; Duration = newDuration; Title = newTitle; Details = newDetails; } public int Time { get; set; } public int Duration { get; set; } public string Title { get; set; } public string Details { get; set; } } ``` -------------------------------- ### Get Customers and Orders from Northwind Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-sampledatautil.adoc Retrieves hierarchical customer and order data from the Northwind database. Assumes the Northwind sample database is installed. ```csharp string connectionString = string.Format("Data Source={0}; Initial Catalog=Northwind; Integrated Security=True", serverAddress); DataSet customerOrderDataSet = GetCustomers(serverAddress); using (SqlConnection conn = new SqlConnection(connectionString)) { SqlCommand orderSelectCommand = new SqlCommand("SELECT OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry FROM Orders", conn); SqlDataAdapter orderAdapter = new SqlDataAdapter(orderSelectCommand); try { orderAdapter.Fill(customerOrderDataSet, "Orders"); customerOrderDataSet.Relations.Add("Customer_Orders", customerOrderDataSet.Tables["Customers"].Columns["CustomerID"], customerOrderDataSet.Tables["Orders"].Columns["CustomerID"]); } catch(Exception e) { System.Diagnostics.Debug.WriteLine(e.Message); } } return customerOrderDataSet; } ``` -------------------------------- ### Product Data Initialization Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-datautil.adoc Initializes a list of Product objects with sample data. This is useful for populating data sources or for testing purposes. ```csharp new Product { ProductID = 60, ProductName = "Camembert Pierrot", CategoryID = 4, QuantityPerUnit = "15 - 300 g rounds", UnitPrice = 34.0000m, UnitsInStock = 19, UnitsOnOrder = 0, ReorderLevel = 15, Discontinued = false }, new Product { ProductID = 61, ProductName = "Sirop d\'érable", CategoryID = 2, QuantityPerUnit = "24 - 500 ml bottles", UnitPrice = 28.5000m, UnitsInStock = 113, UnitsOnOrder = 0, ReorderLevel = 25, Discontinued = false }, new Product { ProductID = 63, ProductName = "Vegie-spread", CategoryID = 2, QuantityPerUnit = "15 - 625 g jars", UnitPrice = 43.9000m, UnitsInStock = 24, UnitsOnOrder = 0, ReorderLevel = 5, Discontinued = false }, new Product { ProductID = 16, ProductName = "Pavlova", CategoryID = 3, QuantityPerUnit = "32 - 500 g boxes", UnitPrice = 17.4500m, UnitsInStock = 29, UnitsOnOrder = 0, ReorderLevel = 10, Discontinued = false }, new Product { ProductID = 19, ProductName = "Teatime Chocolate Biscuits", CategoryID = 3, QuantityPerUnit = "10 boxes x 12 pieces", UnitPrice = 9.2000m, UnitsInStock = 25, UnitsOnOrder = 0, ReorderLevel = 5, Discontinued = false }, new Product { ProductID = 20, ProductName = "Sir Rodney\'s Marmalade", CategoryID = 3, QuantityPerUnit = "30 gift boxes", UnitPrice = 81.0000m, UnitsInStock = 40, UnitsOnOrder = 0, ReorderLevel = 0, Discontinued = false }, new Product { ProductID = 69, ProductName = "Gudbrandsdalsost", CategoryID = 4, QuantityPerUnit = "10 kg pkg.", UnitPrice = 36.0000m, UnitsInStock = 26, UnitsOnOrder = 0, ReorderLevel = 15, Discontinued = false }, new Product { ProductID = 71, ProductName = "Flotemysost", CategoryID = 4, QuantityPerUnit = "10 - 500 g pkgs.", UnitPrice = 21.5000m, UnitsInStock = 26, UnitsOnOrder = 0, ReorderLevel = 0, Discontinued = false }, new Product { ProductID = 72, ProductName = "Mozzarella di Giovanni", CategoryID = 4, QuantityPerUnit = "24 - 200 g pkgs.", UnitPrice = 34.8000m, UnitsInStock = 14, UnitsOnOrder = 0, ReorderLevel = 0, Discontinued = false }, new Product { ProductID = 22, ProductName = "Gustaf\'s Knäckebröd", CategoryID = 5, QuantityPerUnit = "24 - 500 g pkgs.", UnitPrice = 21.0000m, UnitsInStock = 104, UnitsOnOrder = 0, ReorderLevel = 25, Discontinued = false }, new Product { ProductID = 23, ProductName = "Tunnbröd", CategoryID = 5, QuantityPerUnit = "12 - 250 g pkgs.", UnitPrice = 9.0000m, UnitsInStock = 61, UnitsOnOrder = 0, ReorderLevel = 25, Discontinued = false }, new Product { ProductID = 53, ProductName = "Perth Pasties", CategoryID = 6, QuantityPerUnit = "48 pieces", UnitPrice = 32.8000m, UnitsInStock = 0, UnitsOnOrder = 0, ReorderLevel = 0, Discontinued = false } ``` -------------------------------- ### Get Customers from Northwind (C#) Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-sampledatautil.adoc Retrieves a flat DataSet containing customer information from the Northwind database. Assumes the Northwind database is installed. ```csharp using System; using System.Data; using System.Data.SqlClient; namespace IGDocumentation { public static class SampleDataUtil { //This method assumes that you have the Northwind sample database installed //This method will return a flat DataSet with Customer information from the Northwind database. public static DataSet GetCustomers(string serverAddress) { string connectionString = string.Format("Data Source={0}; Initial Catalog=Northwind; Integrated Security=True", serverAddress); DataSet customerDataSet = new DataSet("Northwind"); ``` -------------------------------- ### Full Code Behind Example (Visual Basic) Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamtimeline-binding-to-data-with-xamtimeline.adoc Initializes the xamTimeline with a custom data collection, populates it, and configures the series with data binding. ```vb Imports System.Windows.Controls Imports System.Collections.ObjectModel Imports Infragistics.Controls.Timelines Namespace Application1 Public Partial Class MainPage Inherits UserControl Public Sub New() InitializeComponent() Dim collection As New ObservableCollection(Of TimelineData)() For i As Integer = 1 To 9 Dim dataEntry As New TimelineData() With { _ Key .Time = i * 100, Key .Duration = 10, Key .Title = "Data Title " & i, Key .Details = "Data Description " & i } collection.Add(dataEntry) Next Dim series As New NumericTimeSeries() series.Title = "Series With Data Binding" series.DataSource = collection series.DataMapping = "Time=Time;Duration=Duration;Title=Title;Details=Details" Me.xamTimeline.Series.Add(series) End Sub End Class Public Class TimelineData Public Sub New() End Sub Public Sub New(newTime As Integer, newDuration As Integer, newTitle As String, newDetails As String) Time = newTime Duration = newDuration Title = newTitle Details = newDetails End Sub Public Property Time() As Integer Get Return m_Time End Get Set m_Time = Value End Set End Property Private m_Time As Integer Public Property Duration() As Integer Get Return m_Duration End Get Set m_Duration = Value End Set End Property Private m_Duration As Integer ``` -------------------------------- ### Visual Basic Block Structure Example Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/ig-spe-synchronizer-pair-strategy.adoc Demonstrates a typical block structure in Visual Basic, including class, property, and get accessor definitions. ```vb Class X ReadOnly Property A Get Return Nothing End Get End Property End Class ``` -------------------------------- ### Generate Sample Project Data in Visual Basic Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamgantt-projectdatahelper.adoc This Visual Basic code provides an equivalent to the C# example for generating sample project data. It demonstrates creating a Project and populating it with ProjectTasks, including setting durations and constraints. ```vb Imports Infragistics.Controls.Schedules Public Class ProjectDataHelper Public Shared Function GenerateProjectData() As Project ' Create a Project instance Dim project As New Project() ' Create a project root ProjectTask Dim rootTask As New ProjectTask() With { .TaskName = "Project Summary Task", .IsManual = False } ' Add the root task to the project project.RootTask.Tasks.Add(rootTask) ' Dates in xamGantt are stored in UTC Dim startTime As DateTime = DateTime.Today.ToUniversalTime() ' Add ProjectTask subtasks to the root project task rootTask.Tasks.Add(New ProjectTask() With { .TaskName = "Planning", .IsManual = False, .Start = startTime, .Duration = TimeSpan.FromHours(8) }) ' Configure task duration ' Set task constraint ``` -------------------------------- ### Get Customers from Northwind (Visual Basic) Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-sampledatautil.adoc Retrieves a flat DataSet containing customer information from the Northwind database. Assumes the Northwind database is installed. ```vb Imports System.Data Imports System.Data.SqlClient Public NotInheritable Class SampleDataUtil Private Sub New() End Sub 'This method assumes that you have the Northwind sample database installed 'This method will return a flat DataSet with Customer information from the Northwind database. Public Shared Function GetCustomers(ByVal serverAddress As String) As DataSet Dim connectionString As String = String.Format("Data Source={0}; Initial Catalog=Northwind; Integrated Security=True", serverAddress) Dim customerDataSet As New DataSet("Northwind") 'Create a SqlConnection. Using conn As New SqlConnection(connectionString) 'Create the select Command that will retrieve all fields in the Customers table. Dim customerSelectCommand As New SqlCommand("SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax FROM Customers", conn) 'Create a data adapter using the Command object created above. Dim customerAdapter As New SqlDataAdapter(customerSelectCommand) Try 'Fill the DataSet. customerAdapter.Fill(customerDataSet, "Customers") Catch e As Exception 'Silently fail if something goes wrong and write the exception message to the debug output window. System.Diagnostics.Debug.WriteLine(e.Message) End Try End Using Return customerDataSet End Function ``` -------------------------------- ### Full XamDataGrid example with TemplateField Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/configuring-template-field.adoc This XAML code demonstrates a complete XamDataGrid setup, including defining various fields and a TemplateField with both display and edit templates. ```xaml ``` -------------------------------- ### Initiate WCF Service Call (Visual Basic) Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/generalprogrammingconcepts-creating-a-wcf-service-with-visual-studio-2010.adoc Creates an instance of the WCF service client, subscribes to the ProductListCompleted event, and asynchronously calls the ProductList operation. ```vbnet Dim client As New NorthwindDataServiceClient() client.ProductListCompleted += New EventHandler(Of ProductListCompletedEventArgs)(serviceRef_ProductListCompleted) client.ProductListAsync() ``` -------------------------------- ### Get Customers and Orders from Northwind (Visual Basic) Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-sampledatautil.adoc Retrieves a hierarchical DataSet with customer and order information from the Northwind database. Assumes the Northwind database is installed. ```vb Public Shared Function GetCustomersOrders(ByVal serverAddress As String) As DataSet Dim connectionString As String = String.Format("Data Source={0}; Initial Catalog=Northwind; Integrated Security=True", serverAddress) 'Initialize the DataSet with Customer data. Dim customerOrderDataSet As DataSet = GetCustomers(serverAddress) Using conn As New SqlConnection(connectionString) Dim orderSelectCommand As New SqlCommand("SELECT OrderID, CustomerID, EmployeeID, OrderDate, RequiredDate, ShippedDate, ShipVia, Freight, ShipName, ShipAddress, ShipCity, ShipRegion, ShipPostalCode, ShipCountry FROM Orders", conn) Dim orderAdapter As New SqlDataAdapter(orderSelectCommand) Try orderAdapter.Fill(customerOrderDataSet, "Orders") 'After filling the Orders DataTable, add a DataRelation between the Customers DataTable and the Orders DataTable. customerOrderDataSet.Relations.Add("Customer_Orders", customerOrderDataSet.Tables("Customers").Columns("CustomerID"), customerOrderDataSet.Tables("Orders").Columns("CustomerID")) Catch e As Exception System.Diagnostics.Debug.WriteLine(e.Message) End Try End Using Return customerOrderDataSet End Function ``` -------------------------------- ### Applying GPLv3 to a New Program Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/resources-gnu-general-public-license-v3.adoc Include these notices at the start of each source file when applying the GNU General Public License v3 to your program. This ensures the exclusion of warranty and provides necessary licensing information. ```text >one line to give the program's name and a brief idea of what it does.< Copyright (C) >year< >name of author< This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. ``` -------------------------------- ### Pruning Based on Name Example Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/ig-spe-pruning-the-syntax-tree.adoc Non-terminal symbols starting with an underscore are excluded from the syntax tree, and their children are promoted. This is useful for helper symbols that reduce grammar complexity. ```text FieldDeclaration = _typeMemberPrefix, Semicolon; MethodDeclaration = _typeMemberPrefix, ParameterList, MethodBody; PropertyDeclaration = _typeMemberPrefix, PropertyBody; _typeMemberPrefix = Attributes, Modifiers, Type, Identifier; ``` -------------------------------- ### Confirming Task Deletion in XAML Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamgantt-other-events-and-events-arguments.adoc This XAML snippet shows the setup for a ListBackedProject, which is the data provider for the XamGantt control. It's the starting point for handling task deletion events. ```xaml ``` ```csharp var report = new Report(); var section = new EmbeddedVisualReportSection(this.xamPivotGrid); report.Sections.Add(section); var printingTheme = new ResourceDictionary() { Source = new Uri("/AssemblyName;component/Folder/XamPivotGrid.Printing.xaml", UriKind.RelativeOrAbsolute) }; section.Resources.MergedDictionaries.Add(printingTheme); report.ReportSettings.HorizontalPaginationMode = HorizontalPaginationMode.Mosaic; this.pivotGrid.ReportSettings.ColumnHeaderCellSettings.RepeatHeaders = true; this.pivotGrid.ReportSettings.RowHeaderCellSettings.RepeatHeaders = false; this.xamReportPreview.GeneratePreview(report, false, false); report.Export(OutputFormat.XPS, "PivotReport", true); report.Print(true, false); ``` ```vb Dim report = New Report() Dim section = New EmbeddedVisualReportSection(Me.xamPivotGrid) report.Sections.Add(section) Dim printingTheme = New ResourceDictionary() With { .Source = New Uri("/AssemblyName;component/Folder/XamPivotGrid.Printing.xaml", UriKind.RelativeOrAbsolute) } section.Resources.MergedDictionaries.Add(printingTheme) report.ReportSettings.HorizontalPaginationMode = HorizontalPaginationMode.Mosaic Me.pivotGrid.ReportSettings.ColumnHeaderCellSettings.RepeatHeaders = True Me.pivotGrid.ReportSettings.RowHeaderCellSettings.RepeatHeaders = False Me.xamReportPreview.GeneratePreview(report, False, False) report.Export(OutputFormat.XPS, "PivotReport", True) report.Print(True, False) ``` -------------------------------- ### Retrieve XamTile Reference in C# Source: https://github.com/infragistics/docs-wpf/blob/main/topics/en/xamtilemanager-retrieve-a-reference-to-a-tile.adoc Use the TileFromItem method to get a XamTile reference from an item in the Items collection. This example shows how to set the CloseAction property if the tile is found. ```C# using Infragistics.Controls.Layouts; ... XamTile tile1 = this.xamTileManager1.TileFromItem(this.xamTileManager1.Items[0]); if (tile1 != null) { tile1.CloseAction = TileCloseAction.CollapseTile; } ... ```