forked from lepoco/wpfui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b8db424
commit 24a3d10
Showing
6 changed files
with
86 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,62 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using System.Windows; | ||
using System.Windows.Controls; | ||
using System.Windows.Data; | ||
using System.Windows.Documents; | ||
using System.Windows.Input; | ||
using System.Windows.Media; | ||
using System.Windows.Media.Imaging; | ||
using System.Windows.Navigation; | ||
using System.Windows.Shapes; | ||
|
||
namespace Wpf.Ui.SimpleDemo | ||
using System.Windows.Controls; | ||
|
||
namespace Wpf.Ui.SimpleDemo; | ||
|
||
/// <summary> | ||
/// Interaction logic for DashboardPage.xaml | ||
/// </summary> | ||
public partial class DashboardPage : Page | ||
{ | ||
/// <summary> | ||
/// Interaction logic for DashboardPage.xaml | ||
/// </summary> | ||
public partial class DashboardPage : Page | ||
public DashboardPage() | ||
{ | ||
public DashboardPage() | ||
InitializeComponent(); | ||
} | ||
|
||
private void TaskbarStateComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e) | ||
{ | ||
if (sender is not ComboBox comboBox) | ||
return; | ||
|
||
var parentWindow = System.Windows.Window.GetWindow(this); | ||
|
||
if (parentWindow == null) | ||
return; | ||
|
||
var selectedIndex = comboBox.SelectedIndex; | ||
|
||
switch (selectedIndex) | ||
{ | ||
InitializeComponent(); | ||
case 1: | ||
Wpf.Ui.TaskBar.TaskBarProgress.SetValue( | ||
parentWindow, | ||
Wpf.Ui.TaskBar.TaskBarProgressState.Normal, | ||
80); | ||
break; | ||
|
||
case 2: | ||
Wpf.Ui.TaskBar.TaskBarProgress.SetValue( | ||
parentWindow, | ||
Wpf.Ui.TaskBar.TaskBarProgressState.Error, | ||
80); | ||
break; | ||
|
||
case 3: | ||
Wpf.Ui.TaskBar.TaskBarProgress.SetValue( | ||
parentWindow, | ||
Wpf.Ui.TaskBar.TaskBarProgressState.Paused, | ||
80); | ||
break; | ||
|
||
case 4: | ||
Wpf.Ui.TaskBar.TaskBarProgress.SetValue( | ||
parentWindow, | ||
Wpf.Ui.TaskBar.TaskBarProgressState.Indeterminate, | ||
80); | ||
break; | ||
|
||
default: | ||
Wpf.Ui.TaskBar.TaskBarProgress.SetState(parentWindow, Wpf.Ui.TaskBar.TaskBarProgressState.None); | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters