Skip to content

WPF_962531-Need to prepare a UG for static grid lines #1804

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions wpf/Diagram/Gridlines.md
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,53 @@ public class Intervals : List<double>

Find the [Gridlines Custom Spacing Sample](https://github.com/SyncfusionExamples/WPF-Diagram-Examples/tree/master/Samples/Gridlines/GridlineCustomSpacing) to customize the Gridlines spacing.

## Static GridLines

The [`DynamicZoom`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Diagram.Gridlines.html#Syncfusion_UI_Xaml_Diagram_Gridlines_DynamicZoom) property of the [`GridLines`](https://help.syncfusion.com/cr/wpf/Syncfusion.UI.Xaml.Diagram.Gridlines.html) class allows you to control whether the gridlines should zoom in or out during zooming operations. To prevent the gridlines from zooming, set this property to `false`. By default, the **DynamicZoom** property is set to `true`.

{% tabs %}
{% highlight xaml %}

<!--Initialize SfDiagram-->
<syncfusion:SfDiagram x:Name="diagram" >
<!--Initialize Snap Settings-->
<syncfusion:SfDiagram.SnapSettings>
<syncfusion:SnapSettings SnapConstraints="ShowLines">
<!--Initialize Horizontal Gridlines-->
<syncfusion:SnapSettings.HorizontalGridlines>
<syncfusion:Gridlines DynamicZoom="False" />
</syncfusion:SnapSettings.HorizontalGridlines>
<!--Initialize Vertical Gridlines-->
<syncfusion:SnapSettings.VerticalGridlines>
<syncfusion:Gridlines DynamicZoom="False" />
</syncfusion:SnapSettings.VerticalGridlines>
</syncfusion:SnapSettings>
</syncfusion:SfDiagram.SnapSettings>
</syncfusion:SfDiagram>

{% endhighlight %}
{% highlight C# %}

//Initialize SfDiagram
SfDiagram Diagram = new SfDiagram();

Diagram.SnapSettings = new SnapSettings()
{
SnapConstraints = SnapConstraints.ShowLines,
HorizontalGridlines = new Syncfusion.UI.Xaml.Diagram.Gridlines()
{
DynamicZoom = false,
},
VerticalGridlines = new Syncfusion.UI.Xaml.Diagram.Gridlines()
{
DynamicZoom = false,
},
};
{% endhighlight %}
{% endtabs %}

![Snap to Gridlines](Gridlines_images\StaticGridlines.gif)

## See Also

[How to snap the objects on gridlines?](/wpf/diagram/snapping/definesnapping)
Expand Down
Binary file added wpf/Diagram/Gridlines_images/StaticGridlines.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.