.NET XAML - 2.0
Extension ID
com.castsoftware.wpf
What’s new?
See .NET XAML - 2.0 - Release Notes for more information.
Description
This extension provides support for XAML files originating in .NET frameworks such as Xamarin.Forms, WPF and Silverlight. The calculation of Automated Function Points for your .NET analyses will be supplemented through the creation of new links specific to the framework that will link back to objects/links produced by the base .NET analyzer.
In what situation should you install this extension?
If your .NET application contains XAML files and you want to view their links to your C# or VB.NET source code, then you should install this extension. When using AIP Console, the extension will be installed automatically when a .XAML file is encountered in the delivered source code.
Existing extensions for WPF and Silverlight
The .NET XAML extension provides support for two .NET frameworks (WPF and Silverlight) that were previously supported in specific extensions. The development of these existing extensions has been discontinued and all new development to support these frameworks will now be actioned in the .NET XAML extension. Please note the following information:
- You can continue to use the legacy WPF and Silverlight Framework extensions for your analyses, however, no new features or bug fixes will be applied in these extensions (i.e. no new releases of the extensions will be published).
- The .NET XAML extension has the same level of support in its first release for the WPF and Silverlight frameworks as was provided in the most recent release of the legacy WPF and Silverlight Framework extensions, however, the .NET XAML extension uses a different analysis method: instead of generating dedicated WPF and Silverlight objects in the analysis results (as was the case for the existing extensions), the .NET XAML extension only creates links between the XAML files and the .NET application source code.
- If you would like to start using the .NET XAML extension, there is
no direct upgrade path from the legacy WPF and Silverlight
Framework extensions. In addition,
Analysis results generated by this extension are entirely different
to the results generated by the legacy WPF and Silverlight
Framework extensions,
therefore, moving to the .NET XAML extension will impact your
existing analysis results.
- For the Silverlight Framework, CAST does not recommend using the existing Silverlight Framework extension at the same time as the .NET XAML extension (both extensions will generate results for the Silverlight framework, potentially creating confusion). Therefore, moving to the .NET XAML extension will necessarily mean a change in the number of objects and links in your analysis results with additional impacts on rule grades, transactions and function points.
- For the WPF framework, the .NET XAML extension reuses the same extension ID as used by the legacy WPF extension (com.castsoftware.wpf), therefore choosing to use the ≥ 2.0 release of com.castsoftware.wpf will mean that you switch to the .NET XAML extension which will necessarily mean a change in the number of objects and links in your analysis results with additional impacts on rule grades, transactions and function points.
Framework support
The following WPF frameworks are supported by this extension:
Framework |
Version
|
Supported
|
---|---|---|
Xamarin.Forms | All versions up to 5.0 | |
Windows Presentation Foundation | All versions up to 4.5 | |
Silverlight | All versions up to 5.0 |
Function Point, Quality and Sizing support
This extension provides the following support:
- Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
- Quality and Sizing: a green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist
Function Points (transactions) |
Quality and Sizing |
---|---|
AIP Core compatibility
This extension is compatible with:
AIP Core release
|
Supported
|
Languages |
---|---|---|
8.3.x | C# and VB.NET |
Download and installation instructions
When using CAST Console, the extension will be installed automatically when a .XAML file is encountered in the delivered source code. If you need to change the release, use the Included interface in Console:
CAST Transaction Configuration Center (TCC) Entry Points
A set of specific Transaction Entry Points and Ignored Tables for Data Entities are automatically imported when the extension is installed. These Transaction Entry Points will be available in the CAST Transaction Configuration Center:
What results can you expect?
Objects
No objects are generated by the extension. The extension will create links between XAML source files which are produced by .NET Analyzer and the .NET application source code.
xaml pages which are taken into account are those which are defines by following html tags:
- Window
- DockPanel
- Page
- Application
- UserControl
- base:ViewBase
Links
- relyon links to .NET classes
<Page x:Class="Life.Page1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
> ...
<local:LifeView x:Name="lifeView1" Background="Ivory" Foreground="{StaticResource cellBrush}" Padding="20" >
</local:LifeView>
- call links to .NET methods
<ToggleButton Name="btnAnimate" Click="ToggleButton_Click">
</ToggleButton>
- call links to .NET property set and property get
- refer links to the parent property of the getter and setter:
These links are created whenever a property is used inside a xml value between embraces, like in the following example:
<TextBlock Name="label1" VerticalAlignment="Center" Width="100" Text="{Binding ElementName=lifeView1, Path=Generation }"/>
Limitations
In this section we list the most significant functional limitations that may affect the analysis of applications using WPF:
-
Binding in code is not supported - see https://msdn.microsoft.com/en-us/library/ms742863(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1 for an example
-
Binding links are not handled correctly when the same binding target exists in different classes
-
The direction of the data flow (Binding.Mode properties such as OneWay, TwoWay and OneWayToSource) is not supported - see https://msdn.microsoft.com/en-us/library/ms752347(v=vs.110).aspx#direction_of_data_flow for an example
-
The RelativeSource property (Gets or sets the binding source by specifying its location relative to the position of the binding target) is not supported - see https://msdn.microsoft.com/en-us/library/system.windows.data.binding.relativesource(v=vs.110).aspx for an example
-
Links between XAML Source File objects and code embedded in XAML are not supported.