Click here to Skip to main content
15,890,946 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
QuestionForward Email by programattically using asp.net +C# Pin
Alok Kumar Sharma4-Sep-11 8:18
Alok Kumar Sharma4-Sep-11 8:18 
AnswerRe: Forward Email by programattically using asp.net +C# Pin
Wendelius4-Sep-11 10:13
mentorWendelius4-Sep-11 10:13 
QuestionVS 2008 now always throws a XML schema compile warning. Pin
Gregory Gadow1-Sep-11 7:07
Gregory Gadow1-Sep-11 7:07 
AnswerRe: VS 2008 now always throws a XML schema compile warning. Pin
Bert Mitton2-Sep-11 7:45
professionalBert Mitton2-Sep-11 7:45 
QuestionDeadlock issue in batch processing Pin
Dimpal1701-Sep-11 4:38
Dimpal1701-Sep-11 4:38 
AnswerRe: Deadlock issue in batch processing Pin
Wendelius3-Sep-11 4:35
mentorWendelius3-Sep-11 4:35 
AnswerRe: Deadlock issue in batch processing Pin
jschell3-Sep-11 10:24
jschell3-Sep-11 10:24 
QuestionSaving FlowDocument to XPS causes viewer to go blank Pin
Geron31-Aug-11 22:17
Geron31-Aug-11 22:17 
My XAML for the viewer window looks something like this:

HTML
<Window>
  <DockPanel LastChildFill="True">
    <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal">
      <Button Width="100" Height="25" Click="Save_Click">Save</Button>
    </StackPanel>
    <FlowDocumentScrollViewer DockPanel.Dock="Top" VerticalScrollBarVisibility="Auto">
      <FlowDocument x:Name="flowDoc" Background="White" PagePadding="5">
        <BlockUIContainer>
          <!--... Data bound UI stuff-->
        </BlockUIContainer>
      </FlowDocument>
    </FlowDocumentScrollViewer>
  </DockPanel>
</Window>


The Save_Click handler looks like this:

C#
private void Save_Click(object sender, RoutedEventArgs e)
{
  SaveFileDialog dialog = new SaveFileDialog();
  dialog.DefaultExt = "xps";
  dialog.Filter = "XPS Document (*.xps)|*.xps";
  dialog.OverwritePrompt = true;

  if (dialog.ShowDialog() == true)
  {
    using (Package package = Package.Open(dialog.FileName, FileMode.Create, FileAccess.ReadWrite))
    {
      using (XpsDocument xpsDoc = new XpsDocument(package, CompressionOption.Maximum))
      {
        XpsSerializationManager rsm = new XpsSerializationManager(new XpsPackagingPolicy(xpsDoc), false);
        DocumentPaginator paginator = ((IDocumentPaginatorSource)flowDoc).DocumentPaginator;
        rsm.SaveAsXaml(paginator);
        rsm.Commit();
      }
    }
  }
}


Now when I click the "Save" button and enter a file name. The document is saved to a XPS file and all is good. HOWEVER, the FlowDocumentScrollViewer goes completely blank once the file is written to disk.

Is there any way to prevent this behaviour? I've tried some code to clone the FlowDocument via the use of TextRange etc. But the problem with this approach is that the UI elements isnt included in the cloned document, only regular text elements.
AnswerRe: Saving FlowDocument to XPS causes viewer to go blank [modified] Pin
Pradeep Shukla6-Sep-11 17:46
professionalPradeep Shukla6-Sep-11 17:46 
QuestionObject serialization problem Pin
columbos1492730-Aug-11 23:58
columbos1492730-Aug-11 23:58 
AnswerRe: Object serialization problem Pin
Richard Andrew x6431-Aug-11 6:54
professionalRichard Andrew x6431-Aug-11 6:54 
AnswerRe: Object serialization problem Pin
Columbus-MCSD4-Sep-11 17:53
Columbus-MCSD4-Sep-11 17:53 
QuestionI am getting this kind of error,pls help Pin
jitendra rajbher30-Aug-11 23:43
jitendra rajbher30-Aug-11 23:43 
AnswerRe: I am getting this kind of error,pls help Pin
Dave Kreskowiak31-Aug-11 2:09
mveDave Kreskowiak31-Aug-11 2:09 
GeneralRe: I am getting this kind of error,pls help Pin
jitendra rajbher31-Aug-11 3:43
jitendra rajbher31-Aug-11 3:43 
GeneralRe: I am getting this kind of error,pls help Pin
Shameel31-Aug-11 4:19
professionalShameel31-Aug-11 4:19 
GeneralThanks,but I saw that code but i am not able to see may data Pin
jitendra rajbher31-Aug-11 20:47
jitendra rajbher31-Aug-11 20:47 
GeneralRe: I am getting this kind of error,pls help Pin
Dave Kreskowiak31-Aug-11 5:40
mveDave Kreskowiak31-Aug-11 5:40 
QuestionIn VB .NET how do we get the new row ID number in an access database table BEFORE inserting the new row? Pin
aeskan30-Aug-11 4:12
aeskan30-Aug-11 4:12 
AnswerRe: In VB .NET how do we get the new row ID number in an access database table BEFORE inserting the new row? Pin
Pete O'Hanlon30-Aug-11 4:17
mvePete O'Hanlon30-Aug-11 4:17 
GeneralRe: In VB .NET how do we get the new row ID number in an access database table BEFORE inserting the new row? Pin
aeskan30-Aug-11 9:38
aeskan30-Aug-11 9:38 
AnswerRe: In VB .NET how do we get the new row ID number in an access database table BEFORE inserting the new row? Pin
Jitheshvijayan8-Sep-11 20:55
Jitheshvijayan8-Sep-11 20:55 
GeneralRe: In VB .NET how do we get the new row ID number in an access database table BEFORE inserting the new row? Pin
aeskan8-Sep-11 22:40
aeskan8-Sep-11 22:40 
QuestionNot able to find Event icon in Property window [modified] Pin
KIDYA29-Aug-11 21:24
KIDYA29-Aug-11 21:24 
AnswerRe: Not able to find Event icon in Property window Pin
RobCroll30-Aug-11 2:10
RobCroll30-Aug-11 2:10 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.