當前位置: 首頁>>代碼示例>>C#>>正文


C# MetroWindow類代碼示例

本文整理匯總了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;
        }
開發者ID:Acaspita,項目名稱:MahApps.Metro,代碼行數:7,代碼來源:MessageDialog.cs

示例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();
        }
開發者ID:naydnabil,項目名稱:MahApps.Metro,代碼行數:13,代碼來源:BaseMetroDialog.cs

示例3: LoginDialog

 internal LoginDialog(MetroWindow parentWindow, LoginDialogSettings settings)
     : base(parentWindow, settings)
 {
     InitializeComponent();
     Username = settings.InitialUsername;
     UsernameWatermark = settings.UsernameWatermark;
     PasswordWatermark = settings.PasswordWatermark;
     NegativeButtonButtonVisibility = settings.NegativeButtonVisibility;
 }
開發者ID:sonyraj,項目名稱:MahApps.Metro,代碼行數:9,代碼來源:LoginDialog.cs

示例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) { }
        }
開發者ID:korner-brazers,項目名稱:VK-HashTag,代碼行數:20,代碼來源:ProgressDialog.cs

示例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;
 }
開發者ID:zhihuawang,項目名稱:MahApps.Metro,代碼行數:13,代碼來源:LoginDialog.cs

示例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;
     }
 }
開發者ID:huanshifeichen,項目名稱:MahApps.Metro,代碼行數:17,代碼來源:BaseMetroDialog.cs

示例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;
        }
開發者ID:bendetat,項目名稱:MahApps.Metro,代碼行數:26,代碼來源:ProgressDialog.cs

示例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;
        }
開發者ID:Boohyeah,項目名稱:MahApps.Metro,代碼行數:21,代碼來源:BaseMetroDialog.cs

示例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;
         }
     }
 }
開發者ID:djengineerllc,項目名稱:MahApps.Metro,代碼行數:17,代碼來源:LoginDialog.cs

示例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;
        }
開發者ID:darknesstiller,項目名稱:MetodoDeGauss,代碼行數:20,代碼來源:DialogManager.cs

示例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;
        }
開發者ID:NExPlain,項目名稱:MahApps.Metro,代碼行數:23,代碼來源:DialogManager.cs

示例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()))));
 }
開發者ID:NExPlain,項目名稱:MahApps.Metro,代碼行數:4,代碼來源:DialogManager.cs

示例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();
        }
開發者ID:Niahm,項目名稱:MahApps.Metro,代碼行數:15,代碼來源:MessageDialog.cs

示例14: CustomDialog

 public CustomDialog(MetroWindow parentWindow)
     : this(parentWindow, null)
 {
 }
開發者ID:MahApps,項目名稱:MahApps.Metro,代碼行數:4,代碼來源:CustomDialog.cs

示例15: LoginDialog

 internal LoginDialog(MetroWindow parentWindow)
     : this(parentWindow, null)
 {
 }
開發者ID:MahApps,項目名稱:MahApps.Metro,代碼行數:4,代碼來源:LoginDialog.cs


注:本文中的MetroWindow類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。