Click here to Skip to main content
14,733,866 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm looking a way to blur FlowDocument like this:
FlowDocument doc = new FlowDocument();
BlurEffect blur = new BlurEffect();
blur.Radius = 10;
doc.Effect = blur; // it doesn't work! (FlowDocument doesn't have Effect property)
Update:
Above code is a part of a Converter which return FlowDocument for using in a FlowDocumentScrollViewer. Some items (returned flow documents) have specific conditions which should be blurred.
<DataGrid ItemsSource="{Binding Items}">
  <DataGrid.Columns>
     <DataGridTemplateColumn>  
         <DataGridTemplateColumn.CellTemplate>          
           <DataTemplate>
              <FlowDocumentScrollViewer 
                Document="{Binding ., Converter={StaticResource ItemToFlowDocConverter}}"/>                
           </DataTemplate>  
         <DataGridTemplateColumn.CellTemplate>       
    </DataGridTemplateColumn>
</DataGrid.Columns>


What I have tried:

I don't have any idea to try. Realy I don't have any idea to try.
Posted
Updated 6-Oct-20 20:09pm

1 solution

<DataGrid ItemsSource="{Binding Items}">
  <DataGrid.Columns>
     <DataGridTemplateColumn>  
         <DataGridTemplateColumn.CellTemplate>          
           <DataTemplate>

              <FlowDocumentScrollViewer 
                Document="{Binding ., 
                 Converter={StaticResource ItemToFlowDocConverter}}">
                 <FlowDocumentScrollViewer.Effect>
                   <BlurEffect Radius="10" />
                 </FlowDocumentScrollViewer.Effect>
              </FlowDocumentScrollViewer>

           </DataTemplate>  
         <DataGridTemplateColumn.CellTemplate>       
    </DataGridTemplateColumn>
</DataGrid.Columns>
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900