Hi Joost van Gils,
Greetings from Syncfusion.
We can change the icon of the Print Preview dialog by updating PrintPreviewWindow’s Icon property as below:
<Application x:Class="SfDiagram_Sample.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:diagramControls="clr-namespace:Syncfusion.UI.Xaml.Diagram.Controls;assembly=Syncfusion.SfDiagram.WPF" StartupUri="MainWindow.xaml"> <Application.Resources> <Style TargetType="diagramControls:PrintPreviewWindow"> <Setter Property="Icon" Value="/SfDiagram
Sample;component/App.ico"/> </Style> </Application.Resources> </Application> |
Regards,
Prakash
P
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Syncfusion.Themes.Office2019Colorful.WPF;component/SfDiagram/SfDiagram.xaml"/>
<ResourceDictionary Source="/Syncfusion.Themes.Office2019Colorful.WPF;component/PrintPreview/PrintPreview.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="diagramControls:PrintPreviewWindow" BasedOn="{StaticResource SyncfusionPrintPreviewWindowStyle}">
<Setter Property="Icon" Value="/Simple SfDiagram WPF;component/Asset/Symbol.png"/>
</Style>
</ResourceDictionary>
</Application.Resources>
|
<Application.Resources>
<Style TargetType="syncfusion:ChromelessWindow" x:Key="PrintWindowStyle">
<Setter Property="Icon" Value="..\..\print.png"/>
<Setter Property="Title" Value="Print Preview"/>
</Style>
</Application.Resources>
this.dataGrid.PrintSettings.PrintPreviewWindowStyle = App.Current.Resources["PrintWindowStyle"] as Style; |
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="/Syncfusion.Themes.MaterialLight.WPF;component/GridPrintPreviewControl/GridPrintPreviewControl.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="syncfusion:ChromelessWindow" x:Key="PrintWindowStyle" BasedOn="{StaticResource SyncfusionChromelessWindowStyle}">
<Setter Property="Icon" Value="..\..\print.png"/>
<Setter Property="Title" Value="Print Preview"/>
</Style>
</ResourceDictionary>
</Application.Resources> |
dataGrid.PrintSettings.PrintManagerBase = new CustomPrintManager(this.dataGrid);
this.dataGrid.PrintSettings.PrintPreviewWindowStyle = App.Current.Resources["PrintWindowStyle"] as Style;
this.dataGrid.PrintSettings.AllowPrintByDrawing = false;
this.dataGrid.PrintSettings.AllowPrintStyles = false;
this.dataGrid.ShowPrintPreview();
public class CustomPrintManager : GridPrintManager
{
public CustomPrintManager(SfDataGrid grid)
: base(grid)
{
}
protected override object GetColumnElement(object record, string mappingName)
{
var columnElement = base.GetColumnElement(record, mappingName) as TextBlock; if (columnElement != null)
{
columnElement.Foreground = new SolidColorBrush(Colors.Blue);
}
return columnElement;
}
protected override UIElement GetColumnHeaderElement(string mappingName)
{
var columnElement = base.GetColumnHeaderElement(mappingName) as TextBlock; if (columnElement != null)
{
columnElement.Foreground = new SolidColorBrush(Colors.Blue);
}
return columnElement;
}
} |