|
@@ -54,6 +54,27 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private string _rotationText = "0";
|
|
|
+ public string RotationText
|
|
|
+ {
|
|
|
+ get { return _rotationText; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref _rotationText, value);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private string _opacityText = "100 %";
|
|
|
+ public string OpacityText
|
|
|
+ {
|
|
|
+ get { return _opacityText; }
|
|
|
+ set
|
|
|
+ {
|
|
|
+ SetProperty(ref _opacityText, value);
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<string> _relativeRatioList = new List<string>();
|
|
|
public List<string> RelativeRatioList
|
|
|
{
|
|
@@ -227,8 +248,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
|
|
|
public void InitComponent()
|
|
|
{
|
|
|
- InitOpacityList();
|
|
|
InitRotationList();
|
|
|
+ InitOpacityList();
|
|
|
InitRelativeRatioList();
|
|
|
}
|
|
|
|
|
@@ -290,7 +311,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
public void ChangeColor(object e)
|
|
|
{
|
|
|
if (e != null)
|
|
@@ -307,7 +328,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
{
|
|
|
if (backgroundItem != null)
|
|
|
{
|
|
|
- backgroundItem.type = backgroundInfo.BackgroundType;
|
|
|
+ backgroundItem.type = C_Background_Type.BG_TYPE_COLOR;
|
|
|
backgroundItem.bgColor = backgroundInfo.Color;
|
|
|
backgroundItem.horizalign = backgroundInfo.Horizalign;
|
|
|
backgroundItem.vertalign = backgroundInfo.Vertalign;
|
|
@@ -357,8 +378,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
tempBackground.SetBackgroundType(BackgroundInfo.BackgroundType);
|
|
|
tempBackground.SetColor(BackgroundInfo.Color);
|
|
|
tempBackground.SetScale(1);
|
|
|
- tempBackground.SetRotation(BackgroundInfo.Rotation);
|
|
|
- tempBackground.SetOpacity(BackgroundInfo.Opacity);
|
|
|
+ tempBackground.SetRotation((float)((BackgroundInfo.Rotation / 180) * Math.PI));
|
|
|
+ tempBackground.SetOpacity((byte)((BackgroundInfo.Opacity / 100) * 255));
|
|
|
tempBackground.SetVertalign(BackgroundInfo.Vertalign);
|
|
|
tempBackground.SetHorizalign(BackgroundInfo.Horizalign);
|
|
|
tempBackground.SetXOffset(BackgroundInfo.HorizOffset);
|
|
@@ -398,7 +419,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
{
|
|
|
if (backgroundItem != null)
|
|
|
{
|
|
|
- backgroundInfo.BackgroundType = backgroundItem.type;
|
|
|
+ backgroundInfo.BackgroundType = C_Background_Type.BG_TYPE_COLOR;
|
|
|
backgroundInfo.Color = backgroundItem.bgColor;
|
|
|
backgroundInfo.Horizalign = backgroundItem.horizalign;
|
|
|
backgroundInfo.Vertalign = backgroundItem.vertalign;
|
|
@@ -419,10 +440,12 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
{
|
|
|
ConvertItemToInfo(TemplateBackgroundItem, ref BackgroundInfo);
|
|
|
Color = EditToolsHelper.ConvertColor(BackgroundInfo.Color);
|
|
|
- RotationValue = (int)BackgroundInfo.Rotation;
|
|
|
+ RotationText = BackgroundInfo.Rotation.ToString();
|
|
|
+ OpacityText = BackgroundInfo.Opacity.ToString();
|
|
|
InitLocationButtonMatrix();
|
|
|
HorizontalOffsetValue = (BackgroundInfo.HorizOffset).ToString();
|
|
|
VerticalOffsetValue = (BackgroundInfo.VertOffset).ToString();
|
|
|
+ PageRangeSelectIndex = BackgroundInfo.PageRangeIndex;
|
|
|
}
|
|
|
|
|
|
public void ConfirmEditBackgroundTemplateItem(EnumColorOrFileUnicode enumColorOrFileunicode)
|
|
@@ -461,8 +484,8 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
tempBackground.SetBackgroundType(BackgroundInfo.BackgroundType);
|
|
|
tempBackground.SetColor(BackgroundInfo.Color);
|
|
|
tempBackground.SetScale(1);
|
|
|
- tempBackground.SetRotation(BackgroundInfo.Rotation);
|
|
|
- tempBackground.SetOpacity(BackgroundInfo.Opacity);
|
|
|
+ tempBackground.SetRotation((float)((BackgroundInfo.Rotation / 180) * Math.PI));
|
|
|
+ tempBackground.SetOpacity((byte)((BackgroundInfo.Opacity / 100) * 255));
|
|
|
tempBackground.SetVertalign(BackgroundInfo.Vertalign);
|
|
|
tempBackground.SetHorizalign(BackgroundInfo.Horizalign);
|
|
|
tempBackground.SetXOffset(BackgroundInfo.HorizOffset);
|
|
@@ -507,6 +530,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
SaveCurrentTemplate();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
public bool IsNavigationTarget(NavigationContext navigationContext)
|
|
|
{
|
|
|
return true;
|
|
@@ -520,6 +544,7 @@ namespace PDF_Office.ViewModels.EditTools.Background
|
|
|
{
|
|
|
|
|
|
navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
|
|
|
+ EditToolsHelper.GetPageRange(PageRangeSelectIndex, PDFViewer.Document, ref BackgroundInfo.PageRange, PageRangeText);
|
|
|
if (navigationContext.Parameters.TryGetValue<BackgroundItem>("BackgroundItem", out TemplateBackgroundItem))
|
|
|
{
|
|
|
InitComponentBySelectedInfo();
|