Skip to content

Commit 7562007

Browse files
committed
update DemoProject
1 parent 811234f commit 7562007

File tree

2 files changed

+19
-9
lines changed

2 files changed

+19
-9
lines changed

Diff for: DemoProj/MainWindow.xaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
66
xmlns:local="clr-namespace:DemoProj"
77
mc:Ignorable="d"
8-
Title="Metro Messagebox Library Test Project -- HV0905 " Height="450" Width="800">
8+
Title="Metro Messagebox Library Test Project -- HV0905 " Height="265.846" Width="449.692">
99
<Grid>
10-
<Button Content="just open the win" HorizontalAlignment="Left" Margin="49,42,0,0" VerticalAlignment="Top" Width="230" Click="ButtonBase_OnClick"/>
11-
<Button Content="Button" HorizontalAlignment="Left" Margin="124,105,0,0" VerticalAlignment="Top" Width="75" Click="ButtonBase_OnClick_1"/>
12-
<Button Content="Button" HorizontalAlignment="Left" Margin="152,161,0,0" VerticalAlignment="Top" Width="75" Click="ButtonBase_OnClick_2"/>
13-
<Button Content="Do Some Staff" HorizontalAlignment="Left" Margin="124,249,0,0" VerticalAlignment="Top" Width="117" Height="30" Click="ButtonBase_OnClick_3"/>
10+
<Button Content="open custom MessageBox" HorizontalAlignment="Left" Margin="11,34,0,0" VerticalAlignment="Top" Width="230" Click="ButtonBase_OnClick" Height="36"/>
11+
<Button Content="open default MessageBox" HorizontalAlignment="Left" Margin="11,75,0,0" VerticalAlignment="Top" Width="230" Click="ButtonBase_OnClick_1" Height="36"/>
12+
<Button Content="change theme" HorizontalAlignment="Left" Margin="11,116,0,0" VerticalAlignment="Top" Width="230" Click="ButtonBase_OnClick_2" Height="36"/>
13+
<Button Content="Do Some Staff" HorizontalAlignment="Left" Margin="11,155,0,0" VerticalAlignment="Top" Width="230" Height="36" Click="ButtonBase_OnClick_3"/>
1414

1515
</Grid>
1616
</Window>

Diff for: DemoProj/MainWindow.xaml.cs

+14-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ namespace DemoProj
1313
/// </summary>
1414
public partial class MainWindow : Window
1515
{
16+
private bool _secondTheme = false;
17+
1618
public MainWindow()
1719
{
1820
InitializeComponent();
@@ -25,8 +27,9 @@ public MainWindow()
2527
Yes = "是(Y)",
2628
Retry = "重试(R)"
2729
};
28-
QModernMessageBox.GlobalBackground = new SolidColorBrush(Colors.White){Opacity = 0.6};
29-
QModernMessageBox.GlobalForeground = Brushes.Black;
30+
IndeterminateProgressWindow.GlobalBackground = QModernMessageBox.GlobalBackground = new SolidColorBrush(Colors.White){Opacity = 0.6};
31+
IndeterminateProgressWindow.GlobalForeground = QModernMessageBox.GlobalForeground = Brushes.Black;
32+
3033
}
3134

3235
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
@@ -56,8 +59,15 @@ private void ButtonBase_OnClick_1(object sender, RoutedEventArgs e)
5659

5760
private void ButtonBase_OnClick_2(object sender, RoutedEventArgs e)
5861
{
59-
System.Windows.Forms.MessageBox.Show("fdsfdsfsdf", "dfdsfsdfsd", MessageBoxButtons.AbortRetryIgnore,
60-
MessageBoxIcon.Error);
62+
_secondTheme = !_secondTheme;
63+
if (_secondTheme) {
64+
IndeterminateProgressWindow.GlobalBackground = QModernMessageBox.GlobalBackground = new SolidColorBrush(Colors.Black) { Opacity = 0.6 };
65+
IndeterminateProgressWindow.GlobalForeground = QModernMessageBox.GlobalForeground = Brushes.White;
66+
}
67+
else {
68+
IndeterminateProgressWindow.GlobalBackground = QModernMessageBox.GlobalBackground = new SolidColorBrush(Colors.White) { Opacity = 0.6 };
69+
IndeterminateProgressWindow.GlobalForeground = QModernMessageBox.GlobalForeground = Brushes.Black;
70+
}
6171
}
6272

6373
private async void ButtonBase_OnClick_3(object sender, RoutedEventArgs e)

0 commit comments

Comments
 (0)