当前位置: 首页>>代码示例>>C#>>正文


C# Controls.MetroWindow类代码示例

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


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


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