|
@@ -21,6 +21,17 @@ namespace PDF_Master.CustomControl
|
|
Ok
|
|
Ok
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /// <summary>
|
|
|
|
+ /// 图标类型
|
|
|
|
+ /// </summary>
|
|
|
|
+ public enum IconType
|
|
|
|
+ {
|
|
|
|
+ Tip,
|
|
|
|
+ Ask,
|
|
|
|
+ Error,
|
|
|
|
+ None
|
|
|
|
+ }
|
|
|
|
+
|
|
/// <summary>
|
|
/// <summary>
|
|
/// AlertsMessage.xaml 的交互逻辑
|
|
/// AlertsMessage.xaml 的交互逻辑
|
|
/// 因为是纯UI的逻辑显示,所以没有再创建VM
|
|
/// 因为是纯UI的逻辑显示,所以没有再创建VM
|
|
@@ -56,22 +67,6 @@ namespace PDF_Master.CustomControl
|
|
ChbDonotAskAgain.Visibility = Visibility.Visible;
|
|
ChbDonotAskAgain.Visibility = Visibility.Visible;
|
|
Width = 408;
|
|
Width = 408;
|
|
|
|
|
|
- Grid.SetColumn(MiddleCancelBtn, 2);
|
|
|
|
- Grid.SetColumn(OkBtn, 1);
|
|
|
|
- Grid.SetColumn(ChbDonotAskAgain, 0);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Clear();
|
|
|
|
- var column = new ColumnDefinition();
|
|
|
|
- var column2 = new ColumnDefinition();
|
|
|
|
- var column0 = new ColumnDefinition();
|
|
|
|
-
|
|
|
|
- column.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column2.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column0.Width = new GridLength(2, GridUnitType.Star);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column0);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column2);
|
|
|
|
|
|
|
|
if (ownerWindow != null)
|
|
if (ownerWindow != null)
|
|
{
|
|
{
|
|
@@ -93,18 +88,6 @@ namespace PDF_Master.CustomControl
|
|
OkBtn.Content = okBtn;
|
|
OkBtn.Content = okBtn;
|
|
Width = 408;
|
|
Width = 408;
|
|
|
|
|
|
- Grid.SetColumn(OkBtn, 3);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Clear();
|
|
|
|
- var column = new ColumnDefinition();
|
|
|
|
- var column2 = new ColumnDefinition();
|
|
|
|
- var column3 = new ColumnDefinition();
|
|
|
|
- column.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column2.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column3.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column2);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column3);
|
|
|
|
|
|
|
|
this.Show();
|
|
this.Show();
|
|
}
|
|
}
|
|
@@ -121,17 +104,6 @@ namespace PDF_Master.CustomControl
|
|
OkBtn.Content = okBtn;
|
|
OkBtn.Content = okBtn;
|
|
Width = 408;
|
|
Width = 408;
|
|
|
|
|
|
- Grid.SetColumn(MiddleCancelBtn, 1);
|
|
|
|
- Grid.SetColumn(OkBtn, 0);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Clear();
|
|
|
|
- var column = new ColumnDefinition();
|
|
|
|
- var column2 = new ColumnDefinition();
|
|
|
|
- column.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column2.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column2);
|
|
|
|
-
|
|
|
|
this.Show();
|
|
this.Show();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -147,21 +119,6 @@ namespace PDF_Master.CustomControl
|
|
MiddleCancelBtn.Content = cancelBtn2;
|
|
MiddleCancelBtn.Content = cancelBtn2;
|
|
OkBtn.Content = okBtn;
|
|
OkBtn.Content = okBtn;
|
|
|
|
|
|
- Grid.SetColumn(CancelBtn, 2);
|
|
|
|
- Grid.SetColumn(MiddleCancelBtn, 1);
|
|
|
|
- Grid.SetColumn(OkBtn, 0);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Clear();
|
|
|
|
- var column = new ColumnDefinition();
|
|
|
|
- var column2 = new ColumnDefinition();
|
|
|
|
- var column3 = new ColumnDefinition();
|
|
|
|
- column.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column2.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column3.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column2);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column3);
|
|
|
|
-
|
|
|
|
this.Show();
|
|
this.Show();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -175,19 +132,6 @@ namespace PDF_Master.CustomControl
|
|
OkBtn.Content = okBtn;
|
|
OkBtn.Content = okBtn;
|
|
Width = 408;
|
|
Width = 408;
|
|
|
|
|
|
- Grid.SetColumn(OkBtn, 3);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Clear();
|
|
|
|
- var column = new ColumnDefinition();
|
|
|
|
- var column2 = new ColumnDefinition();
|
|
|
|
- var column3 = new ColumnDefinition();
|
|
|
|
- column.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column2.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column3.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column2);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column3);
|
|
|
|
-
|
|
|
|
if (ownerWindow != null)
|
|
if (ownerWindow != null)
|
|
{
|
|
{
|
|
Owner = ownerWindow;
|
|
Owner = ownerWindow;
|
|
@@ -196,7 +140,7 @@ namespace PDF_Master.CustomControl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void ShowDialog(string title, string content, string cancelBtn, string okBtn)
|
|
|
|
|
|
+ public void ShowDialog(string title, string content, string cancelBtn, string okBtn,IconType type = IconType.None)
|
|
{
|
|
{
|
|
TitleText.Text = title;
|
|
TitleText.Text = title;
|
|
ContentText.Text = content;
|
|
ContentText.Text = content;
|
|
@@ -205,16 +149,7 @@ namespace PDF_Master.CustomControl
|
|
OkBtn.Content = okBtn;
|
|
OkBtn.Content = okBtn;
|
|
Width = 408;
|
|
Width = 408;
|
|
|
|
|
|
- Grid.SetColumn(MiddleCancelBtn, 1);
|
|
|
|
- Grid.SetColumn(OkBtn, 0);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Clear();
|
|
|
|
- var column = new ColumnDefinition();
|
|
|
|
- var column2 = new ColumnDefinition();
|
|
|
|
- column.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column2.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column2);
|
|
|
|
|
|
+ ShowIcon(type);
|
|
|
|
|
|
if (ownerWindow != null)
|
|
if (ownerWindow != null)
|
|
{
|
|
{
|
|
@@ -235,20 +170,6 @@ namespace PDF_Master.CustomControl
|
|
MiddleCancelBtn.Content = cancelBtn2;
|
|
MiddleCancelBtn.Content = cancelBtn2;
|
|
OkBtn.Content = okBtn;
|
|
OkBtn.Content = okBtn;
|
|
|
|
|
|
- Grid.SetColumn(CancelBtn, 2);
|
|
|
|
- Grid.SetColumn(MiddleCancelBtn, 1);
|
|
|
|
- Grid.SetColumn(OkBtn, 0);
|
|
|
|
-
|
|
|
|
- BtnGrid.ColumnDefinitions.Clear();
|
|
|
|
- var column = new ColumnDefinition();
|
|
|
|
- var column2 = new ColumnDefinition();
|
|
|
|
- var column3 = new ColumnDefinition();
|
|
|
|
- column.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column2.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- column3.Width = new GridLength(1, GridUnitType.Star);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column2);
|
|
|
|
- BtnGrid.ColumnDefinitions.Add(column3);
|
|
|
|
|
|
|
|
if (ownerWindow != null)
|
|
if (ownerWindow != null)
|
|
{
|
|
{
|
|
@@ -258,6 +179,28 @@ namespace PDF_Master.CustomControl
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private void ShowIcon(IconType type)
|
|
|
|
+ {
|
|
|
|
+ //先隐藏所有图标
|
|
|
|
+ ImgTips.Visibility = Visibility.Collapsed;
|
|
|
|
+
|
|
|
|
+ switch (type)
|
|
|
|
+ {
|
|
|
|
+ case IconType.Tip:
|
|
|
|
+ GridIcon.Visibility = Visibility.Visible;
|
|
|
|
+ ImgTips.Visibility = Visibility.Visible;
|
|
|
|
+ break;
|
|
|
|
+ case IconType.Ask:
|
|
|
|
+ break;
|
|
|
|
+ case IconType.Error:
|
|
|
|
+ break;
|
|
|
|
+ case IconType.None:
|
|
|
|
+ default:
|
|
|
|
+ GridIcon.Visibility = Visibility.Collapsed;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
private void CancelBtn_Click(object sender, RoutedEventArgs e)
|
|
private void CancelBtn_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
{
|