Open Goicox opened 7 years ago
Javier, GraphControl class as a successor of Control class (see Gemini.Modules.GraphEditor/Controls/GraphControl.cs) has Background properties. For example see GraphView.xaml located in Gemini.Demo.Views
<local:GraphControl x:Name="GraphControl" Background="Gray" ...
To remove the grid you probably need to change Generic.xaml file. This code responsible for grid:
<Border.Background>
<VisualBrush TileMode="Tile"
Viewport="0,0,25,25" ViewportUnits="Absolute"
Viewbox="0,0,25,25" ViewboxUnits="Absolute">
<VisualBrush.Visual>
<Border BorderThickness="0 0 1 1"
Height="25" Width="25">
<Border.BorderBrush>
<SolidColorBrush Color="#77A9A9A9" />
</Border.BorderBrush>
</Border>
</VisualBrush.Visual>
</VisualBrush>
</Border.Background>
You can add Visibility="Hidden" properties to prevent the grid being seen.
<Border BorderThickness="0 0 1 1" Height="25" Width="25" Visibility="Hidden">
Or it is better to make a binding, for example like this https://stackoverflow.com/questions/36991311/binding-for-border-visibility-hidden-in-wpf
Aliaksei, thank you for your reply and suggestions. The thing that confuses me is that there are graph properties defined in the Generic.xaml, but others are related to GraphView.xaml (as in the demo example) like the item's background or label background.
I would like to change / access all these properties using a setting page inside Tools/Options/
What do you recommend for this? Thank you, Javier
You need to create two properties in your GraphViewModel.cs and bind their in GraphView.xaml Like this
<local:GraphControl x:Name="GraphControl" Background="{Binding BackgroundColor}"
Great! But how should I do with other properties defined in the Generic.xaml (e.g. grid visibility or spacing)?
Dear All,
I am new to Gemini and I would like to add a settings page to the graphEditor. For instance, I would like to change the graphEditor background color or remove the grid, etc. with a settings view. However, I have noticed that some of these properties are embedded in the Generic.xaml located in:
gemini/src/Gemini.Modules.GraphEditor/Themes/
What would be the best way to do this?
Thank you in advance, Javier