-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1761 from PrismLibrary/IDialogService-Updates
Refactored DialogWindow attached properties
- Loading branch information
Showing
11 changed files
with
57 additions
and
34 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
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
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,40 @@ | ||
using System; | ||
using System.Windows; | ||
|
||
namespace Prism.Services.Dialogs | ||
{ | ||
public class Dialog | ||
{ | ||
public static readonly DependencyProperty WindowStyleProperty = | ||
DependencyProperty.RegisterAttached("WindowStyle", typeof(Style), typeof(Dialog), new PropertyMetadata(null)); | ||
|
||
public static Style GetWindowStyle(DependencyObject obj) | ||
{ | ||
return (Style)obj.GetValue(WindowStyleProperty); | ||
} | ||
|
||
public static void SetWindowStyle(DependencyObject obj, Style value) | ||
{ | ||
obj.SetValue(WindowStyleProperty, value); | ||
} | ||
|
||
public static readonly DependencyProperty WindowStartupLocationProperty = | ||
DependencyProperty.RegisterAttached("WindowStartupLocation", typeof(WindowStartupLocation), typeof(Dialog), new UIPropertyMetadata(WindowStartupLocation.CenterOwner, OnWindowStartupLocationChanged)); | ||
|
||
public static WindowStartupLocation GetWindowStartupLocation(DependencyObject obj) | ||
{ | ||
return (WindowStartupLocation)obj.GetValue(WindowStartupLocationProperty); | ||
} | ||
|
||
public static void SetWindowStartupLocation(DependencyObject obj, WindowStartupLocation value) | ||
{ | ||
obj.SetValue(WindowStartupLocationProperty, value); | ||
} | ||
|
||
private static void OnWindowStartupLocationChanged(DependencyObject sender, DependencyPropertyChangedEventArgs e) | ||
{ | ||
if (sender is Window window) | ||
window.WindowStartupLocation = (WindowStartupLocation)e.NewValue; | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
.../Dialogs/DefaultDialogs/DialogWindow.xaml → ...sm.Wpf/Services/Dialogs/DialogWindow.xaml
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
2 changes: 1 addition & 1 deletion
2
...alogs/DefaultDialogs/DialogWindow.xaml.cs → ...Wpf/Services/Dialogs/DialogWindow.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