• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# MetroWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中MetroWindow的典型用法代码示例。如果您正苦于以下问题:C# MetroWindow类的具体用法?C# MetroWindow怎么用?C# MetroWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



MetroWindow类属于命名空间,在下文中一共展示了MetroWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: SetupExternalDialogWindow

        private static Window SetupExternalDialogWindow(BaseMetroDialog dialog)
        {
            MetroWindow win = new MetroWindow();
            win.ShowInTaskbar = false;
            win.ShowActivated = true;
            win.Topmost = true;
            win.ResizeMode = ResizeMode.NoResize;
            win.WindowStyle = WindowStyle.None;
            win.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            win.ShowTitleBar = false;
            win.ShowCloseButton = false;
            win.WindowTransitionsEnabled = false;
            win.Background = dialog.Background;

            try
            {
                win.GlowBrush = win.TryFindResource("AccentColorBrush") as SolidColorBrush;
            }
            catch (Exception) { }

            win.Width = SystemParameters.PrimaryScreenWidth;
            win.MinHeight = SystemParameters.PrimaryScreenHeight / 4.0;
            win.SizeToContent = SizeToContent.Height;

            GlowWindowBehavior glowWindow = new GlowWindowBehavior();
            glowWindow.Attach(win);

            dialog.ParentDialogWindow = win; //THIS IS ONLY, I REPEAT, ONLY SET FOR EXTERNAL DIALOGS!

            win.Content = dialog;

            EventHandler closedHandler = null;
            closedHandler = (sender, args) => 
            {
                win.Closed -= closedHandler;
                dialog.ParentDialogWindow = null;
                win.Content = null;
            };
            win.Closed += closedHandler;

            return win;
        }
开发者ID:NExPlain,项目名称:MahApps.Metro,代码行数:42,代码来源:DialogManager.cs


示例17: SetupAndOpenDialog

        private static SizeChangedEventHandler SetupAndOpenDialog(MetroWindow window, dynamic d)
        {
            if ((d as BaseMetroDialog) != null)
            {
                BaseMetroDialog dialog = (d as BaseMetroDialog);
                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.metroDialogContainer.Children.Add(dialog);
                dialog.OnShown();

                return sizeHandler;
            }
            else
            {
                WaitBaseMetroDialog dialog = (d as WaitBaseMetroDialog);
                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.metroDialogContainer.Children.Add(dialog);
                dialog.OnShown();

                return sizeHandler;
            }
        }
开发者ID:korner-brazers,项目名称:VK-HashTag,代码行数:43,代码来源:DialogManager.cs


示例18: UpdateMainWindowDpi

		void UpdateMainWindowDpi(MetroWindow window) {
			if (window == Application.Current.MainWindow)
				MainWindowDpi = window.WindowDpi;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:4,代码来源:DpiService.cs


示例19: InputDialog

 internal InputDialog(MetroWindow parentWindow, MetroDialogSettings settings)
     : base(parentWindow, settings)
 {
     InitializeComponent();
 }
开发者ID:remcoros,项目名称:MahApps.Metro,代码行数:5,代码来源:InputDialog.cs


示例20: HandleOverlayOnHide

 private static Task HandleOverlayOnHide(MetroDialogSettings settings, MetroWindow window)
 {
     return (settings == null || settings.AnimateHide ? window.HideOverlayAsync() : Task.Factory.StartNew(() => window.Dispatcher.Invoke(new Action(window.HideOverlay))));
 }
开发者ID:nick121212,项目名称:xima_desktop3,代码行数:4,代码来源:DialogManager.cs



注:本文中的MetroWindow类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# MgResourceIdentifier类代码示例发布时间:2022-05-24
下一篇:
C# MetroThemeStyle类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap