本文整理匯總了C#中MetroWindow類的典型用法代碼示例。如果您正苦於以下問題:C# MetroWindow類的具體用法?C# MetroWindow怎麽用?C# MetroWindow使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
MetroWindow類屬於命名空間,在下文中一共展示了MetroWindow類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: MessageDialog
internal MessageDialog(MetroWindow parentWindow, MetroDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
PART_MessageScrollViewer.Height = DialogSettings.MaximumBodyHeight;
}
示例2: BaseMetroDialog
/// <summary>
/// Initializes a new MahApps.Metro.Controls.BaseMetroDialog.
/// </summary>
/// <param name="owningWindow">The window that is the parent of the dialog.</param>
/// <param name="settings">The settings for the message dialog.</param>
protected BaseMetroDialog(MetroWindow owningWindow, MetroDialogSettings settings)
{
DialogSettings = settings ?? owningWindow.MetroDialogOptions;
OwningWindow = owningWindow;
Initialize();
}
示例3: LoginDialog
internal LoginDialog(MetroWindow parentWindow, LoginDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
Username = settings.InitialUsername;
UsernameWatermark = settings.UsernameWatermark;
PasswordWatermark = settings.PasswordWatermark;
NegativeButtonButtonVisibility = settings.NegativeButtonVisibility;
}
示例4: ProgressDialog
//private const string PART_AffirmativeButton = "PART_AffirmativeButton";
//private const string PART_NegativeButton = "PART_NegativeButton";
//private Button AffirmativeButton = null;
//private Button NegativeButton = null;
//static MessageDialog()
//{
// //DefaultStyleKeyProperty.OverrideMetadata(typeof(MessageDialog), new FrameworkPropertyMetadata(typeof(MessageDialog)));
//}
internal ProgressDialog(MetroWindow parentWindow, MetroDialogSettings settings) : base(parentWindow, settings)
{
InitializeComponent();
try
{
ProgressBarForeground = this.FindResource("AccentColorBrush") as Brush; //Выбо цвета для шариков
}
catch (Exception) { }
}
示例5: LoginDialog
internal LoginDialog(MetroWindow parentWindow, LoginDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
Username = settings.InitialUsername;
Password = settings.InitialPassword;
UsernameWatermark = settings.UsernameWatermark;
PasswordWatermark = settings.PasswordWatermark;
NegativeButtonButtonVisibility = settings.NegativeButtonVisibility;
ShouldHideUsername = settings.ShouldHideUsername;
RememberCheckBoxVisibility = settings.RememberCheckBoxVisibility;
RememberCheckBoxText = settings.RememberCheckBoxText;
}
示例6: BaseMetroDialog
/// <summary>
/// Initializes a new MahApps.Metro.Controls.BaseMetroDialog.
/// </summary>
/// <param name="owningWindow">The window that is the parent of the dialog.</param>
public BaseMetroDialog(MetroWindow owningWindow)
{
switch (owningWindow.MetroDialogOptions.ColorScheme)
{
case MetroDialogColorScheme.Theme:
this.SetResourceReference(BackgroundProperty, "WhiteColorBrush");
break;
case MetroDialogColorScheme.Accented:
this.SetResourceReference(BackgroundProperty, "AccentColorBrush");
this.SetResourceReference(ForegroundProperty, "WhiteColorBrush");
break;
}
}
示例7: ProgressDialog
//private const string PART_AffirmativeButton = "PART_AffirmativeButton";
//private const string PART_NegativeButton = "PART_NegativeButton";
//private Button AffirmativeButton = null;
//private Button NegativeButton = null;
//static MessageDialog()
//{
// //DefaultStyleKeyProperty.OverrideMetadata(typeof(MessageDialog), new FrameworkPropertyMetadata(typeof(MessageDialog)));
//}
internal ProgressDialog(MetroWindow parentWindow, MetroDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
if (parentWindow.MetroDialogOptions.ColorScheme == MetroDialogColorScheme.Theme)
{
try
{
ProgressBarForeground = this.FindResource("AccentColorBrush") as Brush;
}
catch (Exception) { }
}
else
ProgressBarForeground = Brushes.White;
}
示例8: BaseMetroDialog
/// <summary>
/// Initializes a new MahApps.Metro.Controls.BaseMetroDialog.
/// </summary>
/// <param name="owningWindow">The window that is the parent of the dialog.</param>
public BaseMetroDialog(MetroWindow owningWindow, MetroDialogSettings settings)
{
DialogSettings = settings == null ? owningWindow.MetroDialogOptions : settings;
switch (DialogSettings.ColorScheme)
{
case MetroDialogColorScheme.Theme:
this.SetResourceReference(BackgroundProperty, "WhiteColorBrush");
break;
case MetroDialogColorScheme.Accented:
this.SetResourceReference(BackgroundProperty, "AccentColorBrush");
this.SetResourceReference(ForegroundProperty, "IdealForegroundColorBrush");
break;
}
OwningWindow = owningWindow;
}
示例9: LoginDialog
internal LoginDialog(MetroWindow parentWindow, LoginDialogSettings settings)
: base(parentWindow, settings)
{
InitializeComponent();
Username = settings.InitialUsername;
UsernameWatermark = settings.UsernameWatermark;
PasswordWatermark = settings.PasswordWatermark;
NegativeButtonButtonVisibility = settings.NegativeButtonVisibility;
if (settings.EnablePasswordPreview)
{
object resource = Application.Current.FindResource("Win8MetroPasswordBox");
if (resource != null && resource.GetType() == typeof(Style))
{
PART_TextBox2.Style = (Style)resource;
}
}
}
示例10: SetupAndOpenDialog
public static SizeChangedEventHandler SetupAndOpenDialog(MetroWindow window, BaseMetroDialog dialog)
{
dialog.SetValue(Panel.ZIndexProperty, (int)window.overlayBox.GetValue(Panel.ZIndexProperty) + 1);
dialog.MinHeight = window.ActualHeight / 4.0;
dialog.MaxHeight = window.ActualHeight;
SizeChangedEventHandler sizeHandler = (sender, args) =>
{
dialog.MinHeight = window.ActualHeight / 4.0;
dialog.MaxHeight = window.ActualHeight;
};
window.SizeChanged += sizeHandler;
window.metroDialogContainer.Children.Add(dialog); //add the dialog to the container
dialog.OnShown();
return sizeHandler;
}
示例11: SetupAndOpenDialog
private static SizeChangedEventHandler SetupAndOpenDialog(MetroWindow window, BaseMetroDialog dialog)
{
dialog.SetValue(Panel.ZIndexProperty, (int)window.overlayBox.GetValue(Panel.ZIndexProperty) + 1);
dialog.MinHeight = window.ActualHeight / 4.0;
dialog.MaxHeight = window.ActualHeight;
SizeChangedEventHandler sizeHandler = null; //an event handler for auto resizing an open dialog.
sizeHandler = new SizeChangedEventHandler((sender, args) =>
{
dialog.MinHeight = window.ActualHeight / 4.0;
dialog.MaxHeight = window.ActualHeight;
});
window.SizeChanged += sizeHandler;
//window.overlayBox.Visibility = Visibility.Visible; //activate the overlay effect
window.metroDialogContainer.Children.Add(dialog); //add the dialog to the container
dialog.OnShown();
return sizeHandler;
}
示例12: HandleOverlayOnShow
private static Task HandleOverlayOnShow(MetroDialogSettings settings, MetroWindow window)
{
return (settings == null || settings.UseAnimations ? window.ShowOverlayAsync() : Task.Factory.StartNew(() => window.Dispatcher.Invoke(new Action(() => window.ShowOverlay()))));
}
示例13: MessageDialog
//private const string PART_AffirmativeButton = "PART_AffirmativeButton";
//private const string PART_NegativeButton = "PART_NegativeButton";
//private Button AffirmativeButton = null;
//private Button NegativeButton = null;
//static MessageDialog()
//{
// //DefaultStyleKeyProperty.OverrideMetadata(typeof(MessageDialog), new FrameworkPropertyMetadata(typeof(MessageDialog)));
//}
internal MessageDialog(MetroWindow parentWindow)
: base(parentWindow)
{
InitializeComponent();
}
示例14: CustomDialog
public CustomDialog(MetroWindow parentWindow)
: this(parentWindow, null)
{
}
示例15: LoginDialog
internal LoginDialog(MetroWindow parentWindow)
: this(parentWindow, null)
{
}