本文整理汇总了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)
{
}