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

C# Controls.MetroWindow类代码示例

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

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



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

示例1: EnsureWindow

        protected override Window EnsureWindow(object model, object view, bool isDialog)
        {
            var window = view as MetroWindow;
            if (window == null)
            {
                window = new MetroWindow { Content = view, };
                window.SetValue(View.IsGeneratedProperty, true);
                window.Resources.MergedDictionaries.Add(this.themeManager.GetThemeResources());

                var owner = this.InferOwnerOf(window);
                if (owner != null)
                {
                    window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                    window.ShowInTaskbar = false;
                    window.Owner = owner;
                }
                else
                {
                    window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                }
            }
            else
            {
                var owner2 = this.InferOwnerOf(window);
                if (owner2 != null && isDialog)
                {
                    window.ShowInTaskbar = false;
                    window.Owner = owner2;
                }
            }

            return window;
        }
开发者ID:gordonc64,项目名称:AO-Workbench,代码行数:33,代码来源:WindowManager.cs


示例2: Execute

		public async Task<object> Execute( MetroWindow window, object args )
		{
			Window = window;
			Csa = args as ConfirmationServiceArgs;
			Debug.Assert( Csa != null, "Csa != null" );

			Dialog = new ConfirmDialog();

			Tcs = new TaskCompletionSource<bool?>();

			Vm = Dialog.DataContext as ConfirmDialogViewModel;
			Debug.Assert( Vm != null, "Vm != null" );

			Vm.Reset();
			Vm.AffirmativeText = Csa.AffirmativeText;
			Vm.NegativeText = Csa.NegativeText;
			Vm.Title = Csa.Title;
			Vm.Message = Csa.Message;
			Vm.DisplayDontAskAgain = Csa.DisplayDontAskAgain;

			Vm.CloseRequested += Vm_CloseRequested;

			await window.ShowMetroDialogAsync( Dialog );
			return await Tcs.Task;
		}
开发者ID:TheSylence,项目名称:DeVi,代码行数:25,代码来源:ConfirmationService.cs


示例3: Navigate

 public static void Navigate(string text, MetroWindow currentWindow, TargetWindow targetWindow)
 {
     var tagInfo = text;
     var tWindow = GetTargetWindowRef(targetWindow);
     tWindow.Show();
     currentWindow.Hide();
 }
开发者ID:prashanthpp,项目名称:DoyenBiz,代码行数:7,代码来源:NavigationServiceHelper.cs


示例4: SimulationSettingsControl

        public SimulationSettingsControl(MetroWindow containingWindow, SimulationSettings settings, FMTesterConfiguration configuration, ExecutionInstance instance, ExecutionEnvironment environment)
        {            
            InitializeComponent();
            this.containingWindow = containingWindow;
            this.ModelSimulationSettings = settings;
            this.configuration = configuration;
            this.instance = instance;
            this.environment = environment;
            
            if (settings != null)
            {
                ModelSimulationTimeNumUpDown.Value = settings.ModelSimulationTime as double?;
                DesiredValueReachedNumUpDown.Value = settings.StableStartTime as double?;
                SmoothnessStartDifferenceNumUpDown.Value = settings.SmoothnessStartDifference as double?;
                ResponsivenessCloseNumUpDown.Value = settings.ResponsivenessClose as double?;

                DesiredValueNameTextBox.Text = settings.DesiredVariable.Name;
                DesiredValueFromNumUpDown.Value = Decimal.ToDouble(settings.DesiredVariable.FromValue) as double?;
                DesiredValueToNumUpDown.Value = Decimal.ToDouble(settings.DesiredVariable.ToValue) as double?;

                ActualValueNameTextBox.Text = settings.ActualVariable.Name;
                ActualValueFromNumUpDown.Value = Decimal.ToDouble(settings.ActualVariable.FromValue) as double?;
                ActualValueToNumUpDown.Value = Decimal.ToDouble(settings.ActualVariable.ToValue) as double?;

                DisturbanceValueNameTextBox.Text = settings.DisturbanceVariable.Name;
                DisturbanceValueToNumUpDown.Value = Decimal.ToDouble(settings.DisturbanceVariable.ToValue) as double?;
            }
        }
开发者ID:sac16controllertester,项目名称:ControllerTester,代码行数:28,代码来源:SimulationSettingsControl.xaml.cs


示例5: CameraPositioningCalibrationView

 public CameraPositioningCalibrationView(MetroWindow parentWindow, MetroDialogSettings settings)
     : base(parentWindow, settings)
 {
     InitializeComponent();
     DataContextChanged += CameraPositioningCalibrationView_DataContextChanged;
     CloseButton.Command = CloseCommand;
 }
开发者ID:cosmo1911,项目名称:UniMoveStation,代码行数:7,代码来源:CameraPositioningCalibrationView.xaml.cs


示例6: ShowMessage

        public static async Task<MessageDialogResult> ShowMessage(MetroWindow Wnd, string message, MessageDialogStyle dialogStyle)
        {
            var metroWindow = Wnd as MetroWindow;
            metroWindow.MetroDialogOptions.ColorScheme = MetroDialogColorScheme.Accented;

            return await metroWindow.ShowMessageAsync("Atenção", message, dialogStyle, metroWindow.MetroDialogOptions);
        }        
开发者ID:joaonetogodoy,项目名称:AgendaAtendimento,代码行数:7,代码来源:Mensagens.cs


示例7: CalibrateMagnetometer

        public async void CalibrateMagnetometer(MetroWindow window)
        {
            var controller = await window.ShowProgressAsync("Please wait...", "Setting up Magnetometer Calibration.", true);

            await Task.Delay(3000);
            controller.SetTitle("Magnetometer Calibration");
            for (int i = 0; i < 101; i++)
            {
                controller.SetProgress(i / 100.0);
                controller.SetMessage(string.Format("Rotate the controller in all directions: {0}%", i));

                if (controller.IsCanceled) break;
                await Task.Delay(100);
            }
            await controller.CloseAsync();

            if (controller.IsCanceled)
            {
                await window.ShowMessageAsync("Magnetometer Calibration", "Calibration has been cancelled.");
            }
            else
            {
                await window.ShowMessageAsync("Magnetometer Calibration", "Calibration finished successfully.");
            }
        }
开发者ID:cosmo1911,项目名称:UniMoveStation,代码行数:25,代码来源:DesignMotionControllerService.cs


示例8: EnsureWindow

        protected override Window EnsureWindow(object model, object view, bool isDialog) {
            var window = view as Window;

            if (window == null) {
                var metroWindow = new MetroWindow {
                    Content = view,
                    SizeToContent = SizeToContent.WidthAndHeight,
                    TitlebarHeight = 0
                };
                window = metroWindow;
                //Interaction.GetBehaviors(metroWindow).Add(new GlowWindowBehavior());
                metroWindow.SetValue(MoveableWindowBehavior.IsEnabledProperty, true);
                metroWindow.SetValue(View.IsGeneratedProperty, true);

                var owner = InferOwnerOf(window);
                if (owner != null) {
                    window.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                    window.Owner = owner;
                } else
                    window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            } else {
                var owner = InferOwnerOf(window);
                if ((owner != null) && isDialog)
                    window.Owner = owner;
            }

            SetupRxWindow(model, view, window);

            return window;
        }
开发者ID:SIXNetworks,项目名称:withSIX.Desktop,代码行数:30,代码来源:CustomWindowManager.cs


示例9: CameraView

        /// <summary>
        /// Initializes a new instance of the CameraView class.
        /// </summary>
        public CameraView()
        {
            InitializeComponent();
            DataContextChanged += CameraView_DataContextChanged;

            _parentWindow = (MetroWindow) Application.Current.MainWindow;
        }
开发者ID:cosmo1911,项目名称:UniMoveStation,代码行数:10,代码来源:CameraView.xaml.cs


示例10: SwitchProfileDialog

        public SwitchProfileDialog(string[] profiles, MetroWindow parentWindow, MetroDialogSettings settings)
            : base(parentWindow, settings)
        {
            InitializeComponent();

            foreach (string profile in profiles)
                PART_ProfileComboBox.Items.Add(profile);
        }
开发者ID:WELL-E,项目名称:Toxy-WPF,代码行数:8,代码来源:SwitchProfileDialog.xaml.cs


示例11: AddMetroResources

 private void AddMetroResources(MetroWindow window)
 {
     _resourceDictionaries = LoadResources();
     foreach (ResourceDictionary dictionary in _resourceDictionaries)
     {
         window.Resources.MergedDictionaries.Add(dictionary);
     }
 }
开发者ID:tmvishnu,项目名称:Caliburn.Metro,代码行数:8,代码来源:MetroWindowManager.cs


示例12: ShowsWindowCommandsOnTopByDefault

        public async Task ShowsWindowCommandsOnTopByDefault()
        {
            await TestHost.SwitchToAppThread();

            var window = new MetroWindow();

            Assert.True(window.ShowWindowCommandsOnTop);
        }
开发者ID:AleksandarDev,项目名称:MahApps.Metro,代码行数:8,代码来源:MetroWindowTest.cs


示例13: SoftContext

 public SoftContext(MetroWindow window)
 {
     DmSystem = new DmSystem(new DmPlugin());
     MainWindow = window;
     HttpClient = new HttpClient();
     IsLogin = false;
     TaskEngine = new TaskEngine();
 }
开发者ID:AiDaTou,项目名称:DnTool,代码行数:8,代码来源:SoftContext.cs


示例14: AdvancedInputDialog

 internal AdvancedInputDialog(MetroWindow parentWindow, MetroDialogSettings settings)
     : base(parentWindow, settings)
 {
     InitializeComponent();
     PART_AffirmativeButton.Content = settings.AffirmativeButtonText;
     PART_NegativeButton.Content = settings.NegativeButtonText;
     Input = settings.DefaultText;
 }
开发者ID:WELL-E,项目名称:Hurricane,代码行数:8,代码来源:AdvancedInputDialog.xaml.cs


示例15: PerformanceOverview

 public PerformanceOverview()
 {
     mainWindow = Application.Current.Windows.OfType<MetroWindow>().FirstOrDefault(x => x.Title == "Ultimate Festival Organizer");
     ufoVM = (UFOCollectionVM)mainWindow.DataContext;
     DataContext = ufoVM;
     InitializeComponent();
     initialized = true;
 }
开发者ID:Pham0uz,项目名称:UFO,代码行数:8,代码来源:PerformanceOverview.xaml.cs


示例16: ShowsRightWindowCommandsOnTopByDefault

        public async Task ShowsRightWindowCommandsOnTopByDefault()
        {
            await TestHost.SwitchToAppThread();

            var window = new MetroWindow();

            Assert.Equal(WindowCommandsOverlayBehavior.Always, window.RightWindowCommandsOverlayBehavior);
        }
开发者ID:sonyraj,项目名称:MahApps.Metro,代码行数:8,代码来源:MetroWindowTest.cs


示例17: EnsureWindow

        protected override Window EnsureWindow(object model, object view, bool isDialog)
        {
            var metroWindow = view as MetroWindow;
            if (metroWindow == null)
            {
                var userControl = view as UserControl;
                double minHeight = 150D;
                double minWidth = 500D;
                double? height = null;
                double? width = null;
                if (userControl != null)
                {
                    minHeight = userControl.MinHeight;
                    minWidth = userControl.MinWidth;
                    height = userControl.Height;
                    width = userControl.Width;
                }

                metroWindow = new MetroWindow
                {
                    Content = view,
                    SizeToContent = SizeToContent.Manual,
                    MinHeight = minHeight,
                    MinWidth = minWidth,
                    SaveWindowPosition = true
                };
                if (height.HasValue && width.HasValue)
                {
                    metroWindow.Height = height.Value;
                    metroWindow.Width = width.Value;
                }

                foreach (var resourceDict in _resources)
                {
                    metroWindow.Resources.MergedDictionaries.Add(resourceDict);
                }

                metroWindow.SetValue(View.IsGeneratedProperty, true);
                var owner = this.InferOwnerOf(metroWindow);
                if (owner != null)
                {
                    metroWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
                    metroWindow.Owner = owner;
                }
                else
                {
                    metroWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
                }
            }
            else
            {
                var owner = this.InferOwnerOf(metroWindow);
                if (owner != null && isDialog)
                    metroWindow.Owner = owner;
            }

            return metroWindow;
        }
开发者ID:ajryan,项目名称:InterTail,代码行数:58,代码来源:MahWindowManager.cs


示例18: ShowDeleteMultipleGameStatsMessage

		public static async Task<MessageDialogResult> ShowDeleteMultipleGameStatsMessage(MetroWindow window, int count)
		{
			var settings = new MetroDialogSettings {AffirmativeButtonText = "Yes", NegativeButtonText = "No"};
			return
				await
				window.ShowMessageAsync("Delete Games",
				                        "This will delete the selected games (" + count + ").\n\nAre you sure?",
				                        MessageDialogStyle.AffirmativeAndNegative, settings);
		}
开发者ID:hertzg,项目名称:Hearthstone-Deck-Tracker,代码行数:9,代码来源:MessageDialogs.cs


示例19: QuickDropDialog

        public QuickDropDialog(MetroWindow parent)
        {
            _parent = parent;
            InitializeComponent();

            InitDragAndDrop();
            IsOpen = true;
            PictureSlidesLabLogo.Source = ImageUtil.BitmapToImageSource(Properties.Resources.PictureSlidesLab);
        }
开发者ID:digawp,项目名称:PowerPointLabs,代码行数:9,代码来源:QuickDropDialog.xaml.cs


示例20: SALoginDialog

 internal SALoginDialog(MetroWindow parentWindow, LoginDialogSettings settings)
     : base(parentWindow, settings)
 {
     InitializeComponent();
     Username = settings.InitialUsername;
     UsernameWatermark = settings.UsernameWatermark;
     PasswordWatermark = settings.PasswordWatermark;
     NegativeButtonButtonVisibility = settings.NegativeButtonVisibility;
 }
开发者ID:darknesstiller,项目名称:MetodoDeGauss,代码行数:9,代码来源:SALoginDialog.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Dialogs.MetroDialogSettings类代码示例发布时间:2022-05-26
下一篇:
C# Controls.Flyout类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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