-
Notifications
You must be signed in to change notification settings - Fork 179
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
e046cc1
commit ec5e6b9
Showing
7 changed files
with
120 additions
and
10 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
76 changes: 76 additions & 0 deletions
76
...es/Wix# Samples/Managed Setup/CustomUI.WPF.Sequence/Dialogs/MaintenanceTypeDialog.xaml.cs
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 |
---|---|---|
@@ -0,0 +1,76 @@ | ||
using System.Windows.Media.Imaging; | ||
using Caliburn.Micro; | ||
using WixSharp; | ||
using WixSharp.UI.Forms; | ||
|
||
using IO = System.IO; | ||
|
||
namespace WixSharp.UI.WPF.Sequence | ||
{ | ||
public partial class MaintenanceTypeDialog : WpfDialog, IWpfDialog | ||
{ | ||
public MaintenanceTypeDialog() | ||
{ | ||
InitializeComponent(); | ||
} | ||
|
||
public void Init() | ||
{ | ||
ViewModelBinder.Bind(new MaintenanceTypeDialogModel { Host = ManagedFormHost, }, this, null); | ||
} | ||
} | ||
|
||
public class MaintenanceTypeDialogModel : Caliburn.Micro.Screen | ||
{ | ||
public ManagedForm Host; | ||
|
||
ISession session => Host?.Runtime.Session; | ||
IManagedUIShell shell => Host?.Shell; | ||
|
||
public BitmapImage Banner => session?.GetResourceBitmap("WixUI_Bmp_Banner").ToImageSource(); | ||
|
||
void JumpToProgressDialog() | ||
{ | ||
int index = shell.Dialogs.IndexOfDialogImplementing<IProgressDialog>(); | ||
if (index != -1) | ||
shell.GoTo(index); | ||
else | ||
shell.GoNext(); // if user did not supply progress dialog then simply go next | ||
} | ||
|
||
public void Change() | ||
{ | ||
if (session != null) | ||
{ | ||
session["MODIFY_ACTION"] = "Change"; | ||
shell.GoNext(); | ||
} | ||
} | ||
|
||
public void Repair() | ||
{ | ||
if (session != null) | ||
{ | ||
session["MODIFY_ACTION"] = "Repair"; | ||
JumpToProgressDialog(); | ||
} | ||
} | ||
|
||
public void Remove() | ||
{ | ||
if (session != null) | ||
{ | ||
session["REMOVE"] = "ALL"; | ||
session["MODIFY_ACTION"] = "Remove"; | ||
|
||
JumpToProgressDialog(); | ||
} | ||
} | ||
|
||
public void GoPrev() | ||
=> shell?.GoPrev(); | ||
|
||
public void Cancel() | ||
=> Host?.Shell.Cancel(); | ||
} | ||
} |
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
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