-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathRedactionViewModel.cs
51 lines (48 loc) · 1.51 KB
/
RedactionViewModel.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#region Copyright Syncfusion® Inc. 2001-2025.
// Copyright Syncfusion® Inc. 2001-2025. All rights reserved.
// Use of this code is subject to the terms of our license.
// A copy of the current license can be obtained at any time by e-mailing
// licensing@syncfusion.com. Any infringement will be prosecuted under
// applicable laws.
#endregion
using System;
using System.IO;
using System.Windows;
using System.Windows.Resources;
namespace syncfusion.pdfviewerdemos.wpf
{
/// <summary>
/// Represents the view model class
/// </summary>
public class RedactionViewModel
{
private Stream m_documentStream;
/// <summary>
/// Gets or sets the documnet path.
/// </summary>
public Stream DocumentStream
{
get
{
return m_documentStream;
}
set
{
m_documentStream = value;
}
}
/// <summary>
/// Initializes a new instance of the <see cref="RedactionViewModel"/> class.
/// </summary>
public RedactionViewModel()
{
m_documentStream = GetFileStream("Redacted.pdf");
}
private Stream GetFileStream(string fileName)
{
Uri uriResource = new Uri("/syncfusion.pdfviewerdemos.wpf;component/Assets/" + fileName, UriKind.Relative);
StreamResourceInfo streamResourceInfo = Application.GetResourceStream(uriResource);
return streamResourceInfo.Stream;
}
}
}